220 4714 <CAGqM8fbdm705MOoFm0sjKMvxxFHthiFTKo10DtTRaez_iSE+tw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Lawrence Crowl <crowl@googlers.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: lock free traits for functions
Date: Wed, 29 May 2013 12:24:55 -0700
Lines: 34
Approved: news@gmane.org
Message-ID: <CAGqM8fbdm705MOoFm0sjKMvxxFHthiFTKo10DtTRaez_iSE+tw@mail.gmail.com>
References: <4ed4041c-a458-4fc8-ae3d-7534d5d261c2@isocpp.org>
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 1369855497 23645 80.91.229.3 (29 May 2013 19:24:57 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 May 2013 19:24:57 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCY3D77DYUDBBB5MTGGQKGQE4PYWFEA@isocpp.org Wed May 29 21:24:59 2013
Return-path: <std-proposals+bncBCY3D77DYUDBBB5MTGGQKGQE4PYWFEA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vb0-f70.google.com ([209.85.212.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCY3D77DYUDBBB5MTGGQKGQE4PYWFEA@isocpp.org>)
	id 1UhlzV-0003SU-CM
	for gclcip-std-proposals@m.gmane.org; Wed, 29 May 2013 21:24:57 +0200
Original-Received: by mail-vb0-f70.google.com with SMTP id f13sf11565081vbg.5
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 12:24:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlers.com; s=googlers;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from: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=pqmuHjhhh/JxTs/Qc+pH+YQriCPEuZCNUAPJXKqG+7g=;
        b=XS6+ML5NbBXmQHZ2QXD+seUS0u6MSIkQRH5BiJPrYKFSy+fn7nFpSUbj1wn6tABumZ
         i2ujfqMf9kkFqKLsH4/cFhF8F68a/YhxzZ8Jptf+NzXKOs5hjtMMBDhT3/cquJRVuNtw
         sBLnsYo+beoGvaok1BMkrbfwQ8m6JvjC27sc0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to:x-gm-message-state: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=pqmuHjhhh/JxTs/Qc+pH+YQriCPEuZCNUAPJXKqG+7g=;
        b=WnO52qnhDnURK6d8bl1hS/lOQEW1iq2d0ZhRs+aedjm960oYNP3ChzptXGgPy7KRoK
         U0m4x5Y2+trD1QbyrSCA6Dz1wsAsH3dB5vbRkZeGlXt/DMz0gkdFcma60Eq5c3BeH0RO
         qkdiP2Q0dtjoYegceNFAs426wOe2J4WuyMkUXP2UP+MIcOrFyFlZ3d9NIDeRUZguoq1C
         Q5G78U5EqHzSvhcPUfqVb9PQ9JdFlflchhxNrwj7cP44bmuZ9olL3s/Jb4vlWfRONkNh
         4Xk55LK6rla0aYK9PxoEbhj9/Jz5WGfpUht2h1H0pjDqg+87UcAoEDN6PgMWe4/kdt9T
         LNlg==
X-Received: by 10.236.15.34 with SMTP id e22mr2064375yhe.16.1369855496323;
        Wed, 29 May 2013 12:24:56 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.122.102 with SMTP id lr6ls32686qeb.13.gmail; Wed, 29 May
 2013 12:24:55 -0700 (PDT)
X-Received: by 10.49.81.193 with SMTP id c1mr4531504qey.56.1369855495357;
        Wed, 29 May 2013 12:24:55 -0700 (PDT)
Original-Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [2607:f8b0:400d:c01::22d])
        by mx.google.com with ESMTPS id k1si31250236qaz.67.2013.05.29.12.24.55
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 29 May 2013 12:24:55 -0700 (PDT)
Received-SPF: pass (google.com: domain of crowl@google.com designates 2607:f8b0:400d:c01::22d as permitted sender) client-ip=2607:f8b0:400d:c01::22d;
Original-Received: by mail-qc0-f173.google.com with SMTP id c11so4954096qcv.18
        for <std-proposals@isocpp.org>; Wed, 29 May 2013 12:24:55 -0700 (PDT)
X-Received: by 10.229.125.20 with SMTP id w20mr1524245qcr.85.1369855495104;
 Wed, 29 May 2013 12:24:55 -0700 (PDT)
Original-Received: by 10.229.1.196 with HTTP; Wed, 29 May 2013 12:24:55 -0700 (PDT)
In-Reply-To: <4ed4041c-a458-4fc8-ae3d-7534d5d261c2@isocpp.org>
X-Gm-Message-State: ALoCoQm0uO4uz0Lb9Kql5/6t5l8qccneGSoD4nBWTOfXGfu0zzuDiR2uRxYz0+rzF+eAOKdZxNqkyFwy0SarJT5qdQsjDQlICEHTfGN8VN2atWD2TKF3J6ANEyh/rlLMZKUgJUscDYQKeSxf6tlee5ndai9v6ubvlQx8nDw9Lv2kxfw7Jv5kWu8adAzbPBtMlO8mZ9vkTei4
X-Original-Sender: crowl@googlers.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of crowl@google.com designates 2607:f8b0:400d:c01::22d as permitted
 sender) smtp.mail=crowl@google.com;       dkim=pass header.i=@googlers.com;
       dmarc=pass (p=QUARANTINE dis=none) d=googlers.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:4714
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4714>

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 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.



.
