220 4728 <CAOSC0-X=oaikYRbDAY+wf0XZgt8mYre=0aOD9AD4mnYcPyVQRg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: adrien courdavault <adrien59cadri@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: lock free traits for functions
Date: Wed, 29 May 2013 23:12:46 +0200
Lines: 70
Approved: news@gmane.org
Message-ID: <CAOSC0-X=oaikYRbDAY+wf0XZgt8mYre=0aOD9AD4mnYcPyVQRg@mail.gmail.com>
References: <4ed4041c-a458-4fc8-ae3d-7534d5d261c2@isocpp.org> <CAGqM8fbdm705MOoFm0sjKMvxxFHthiFTKo10DtTRaez_iSE+tw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1369861989 29736 80.91.229.3 (29 May 2013 21:13:09 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 May 2013 21:13:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDTNJ6MCWUNRBZG6TGGQKGQEIHHBPFA@isocpp.org Wed May 29 23:13:09 2013
Return-path: <std-proposals+bncBDTNJ6MCWUNRBZG6TGGQKGQEIHHBPFA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ea0-f199.google.com ([209.85.215.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDTNJ6MCWUNRBZG6TGGQKGQEIHHBPFA@isocpp.org>)
	id 1UhngD-0005sE-0n
	for gclcip-std-proposals@m.gmane.org; Wed, 29 May 2013 23:13:09 +0200
Original-Received: by mail-ea0-f199.google.com with SMTP id h10sf7359646eaj.6
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 14:13:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=syt69lgKFY68VWy7ErmfP6NqaMU5NmW+UWiHxqRr2SE=;
        b=MACuO7TD5TNUMsFhjO0PXipHMbZAyBqjL+pBdISP9Vc/Jxb54Gb7dVaev443sVDmCu
         +S56tPQNDY7/kmRkCP/e5x79Bbxp7k6F+2xuPmLhcaY8e3JAM0jR+2NKQeHWm9IyU5wZ
         QvkiIX53XE/mrDcGTofJLCUoghVfsGGaGS89ZBTCwzVNshCfKIhS1I69GFzLlkJRirvA
         EU6xQ7s3Q2P/c04QRZI424jkESlp1EAUojPQ+gaOvhctjt8cRkP3CjAtciznQ0ckePjP
         gUpfMTOkrR3D9sDGPyKvQuOqfqLaZA4xzzXpBnZd7yV77TowBZiCMLkLdwyLmD/Mqwhc
         HKdQ==
X-Received: by 10.180.160.212 with SMTP id xm20mr7108585wib.0.1369861988580;
        Wed, 29 May 2013 14:13:08 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.95.231 with SMTP id dn7ls72858wib.40.gmail; Wed, 29 May
 2013 14:13:07 -0700 (PDT)
X-Received: by 10.15.48.129 with SMTP id h1mr6444864eew.65.1369861987592;
        Wed, 29 May 2013 14:13:07 -0700 (PDT)
Original-Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com [2a00:1450:4010:c03::22f])
        by mx.google.com with ESMTPS id b5si23062564eew.74.2013.05.29.14.13.07
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 29 May 2013 14:13:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of adrien59cadri@gmail.com designates 2a00:1450:4010:c03::22f as permitted sender) client-ip=2a00:1450:4010:c03::22f;
Original-Received: by mail-la0-f47.google.com with SMTP id fq12so9021537lab.6
        for <std-proposals@isocpp.org>; Wed, 29 May 2013 14:13:07 -0700 (PDT)
X-Received: by 10.112.148.104 with SMTP id tr8mr2475260lbb.56.1369861986953;
 Wed, 29 May 2013 14:13:06 -0700 (PDT)
Original-Received: by 10.152.4.234 with HTTP; Wed, 29 May 2013 14:12:46 -0700 (PDT)
In-Reply-To: <CAGqM8fbdm705MOoFm0sjKMvxxFHthiFTKo10DtTRaez_iSE+tw@mail.gmail.com>
X-Original-Sender: adrien59cadri@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of adrien59cadri@gmail.com designates 2a00:1450:4010:c03::22f as
 permitted sender) smtp.mail=adrien59cadri@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4728
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4728>

Hi

Clearly a static info would be great if possible, that is why i said a trait
I don't have a clear list in mind, but any "status" function like
future::valid I would like to have this feature
also, It could be interesting on some containers in general or
allocators (like allocators). But this could also be done by choosing
policies (the problem could then be that some policies are not
implemented). I looked at the lockfree lib of boost recently, it is
nice but not so clear to use.

In general that could be useful for anything which depending on the
implementation should or may be lock free or not.
Also then comes the issue of lock free vs wait free ...

I don't know really what is best but I really miss a feature that
could be used to say this is ok, this is not.

Finally the problem with compile time would be for dlls.. maybe having
a way to get this compile time info at runtime would be nice, so it
would work with dll/so too.

I know this is not really clear

On 29 May 2013 21:24, Lawrence Crowl <crowl@googlers.com> wrote:
> On 5/29/13, adrien courdavault <adrien59cadri@gmail.com> wrote:
>> This seams to be a very simplistic request but I think it would be
>> nice to have some traits to know if a function call is lock free
>> or not.  It is not usefull for every function, but it could be
>> for the class like thread obviously.  Clearly launching a thread
>> is not, but depending on the implementation get_id could be;
>>
>> I say that because in time critical thread you want to know it
>> it is safe to do that.  In my case i want to know if I am in the
>> time critical thread, ... problem, if asking for the id of the
>> thread is not lock free I might just have break the rule I wanted
>> to inforce by asking if I was in this thread, what do you think?
>
> We might be able to provide this query definitively for a
> pre-determined set of functions.  In general, though, I think we
> would need to be able to answer "don't know".
>
> Do you have a list of other functions for which you must know?
> Do you need a dynamic test, i.e. on a function pointer, or can
> you live with a static test, i.e. on a template argument?
>
> --
> Lawrence Crowl
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.org/d/topic/std-proposals/2iCzaKc2PRE/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



.
