220 4800 <CAOSC0-XwpiwrjqUwQOOsnz41bVmpMp1c4MBdcV1tJHborCtXLA@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: Mon, 3 Jun 2013 02:00:45 +0200
Lines: 72
Approved: news@gmane.org
Message-ID: <CAOSC0-XwpiwrjqUwQOOsnz41bVmpMp1c4MBdcV1tJHborCtXLA@mail.gmail.com>
References: <4ed4041c-a458-4fc8-ae3d-7534d5d261c2@isocpp.org>
 <CAGqM8fbdm705MOoFm0sjKMvxxFHthiFTKo10DtTRaez_iSE+tw@mail.gmail.com>
 <CAOSC0-X=oaikYRbDAY+wf0XZgt8mYre=0aOD9AD4mnYcPyVQRg@mail.gmail.com> <9b77805b-9e58-41ee-8918-40d726a1a006@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 1370217668 2476 80.91.229.3 (3 Jun 2013 00:01:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 3 Jun 2013 00:01:08 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDTNJ6MCWUNRBQ5ZV6GQKGQENQLWRUA@isocpp.org Mon Jun 03 02:01:09 2013
Return-path: <std-proposals+bncBDTNJ6MCWUNRBQ5ZV6GQKGQENQLWRUA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f199.google.com ([209.85.212.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDTNJ6MCWUNRBQ5ZV6GQKGQENQLWRUA@isocpp.org>)
	id 1UjICz-0001f2-2Q
	for gclcip-std-proposals@m.gmane.org; Mon, 03 Jun 2013 02:01:09 +0200
Original-Received: by mail-wi0-f199.google.com with SMTP id hi5sf2616571wib.2
        for <gclcip-std-proposals@m.gmane.org>; Sun, 02 Jun 2013 17:01: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=AOWhpizPz1fd0ts2OPQQIVQgMWonsQZbT1Esqa02L3k=;
        b=gPpnCxg/97tPF6odXOPAsObjbe+8+pIjx1CTMD3HOuhPy7Dl5Ej4jq7vyl2rzsdoB4
         JY3awA1MajOdRGX+xkn0EkLamwQbT7u4Mn4A4Dqr6lje2u/j6xcADf72lUfaetgqhY8d
         o7l+PDh9p7YFPf0aUv6TgNWXfNmOs9DA49xXDXD51SxYuJcxvm3IynhP8XCfF3LMPG3A
         IzU3mQJG9uhNaEXq/HvCpNnzoyxANynlSs7KynDXTzvdKrquPjhlCXIjv6IGJQtXhn/v
         N6ihB6br2ZXKjxrINESpUf6Xr6kHH77ntn59z3yixiSOjEjm66VF12vlmn1js8EwPj1Z
         C+PQ==
X-Received: by 10.152.4.168 with SMTP id l8mr4701844lal.9.1370217668217;
        Sun, 02 Jun 2013 17:01:08 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.5.194 with SMTP id u2ls86305lau.55.gmail; Sun, 02 Jun 2013
 17:01:06 -0700 (PDT)
X-Received: by 10.152.26.166 with SMTP id m6mr9803160lag.50.1370217666528;
        Sun, 02 Jun 2013 17:01:06 -0700 (PDT)
Original-Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [2a00:1450:4010:c03::22c])
        by mx.google.com with ESMTPS id wf10si7684045lbb.247.2013.06.02.17.01.05
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 02 Jun 2013 17:01:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of adrien59cadri@gmail.com designates 2a00:1450:4010:c03::22c as permitted sender) client-ip=2a00:1450:4010:c03::22c;
Original-Received: by mail-la0-f44.google.com with SMTP id er20so786296lab.31
        for <std-proposals@isocpp.org>; Sun, 02 Jun 2013 17:01:05 -0700 (PDT)
X-Received: by 10.112.155.65 with SMTP id vu1mr9911836lbb.12.1370217665112;
 Sun, 02 Jun 2013 17:01:05 -0700 (PDT)
Original-Received: by 10.152.19.104 with HTTP; Sun, 2 Jun 2013 17:00:45 -0700 (PDT)
In-Reply-To: <9b77805b-9e58-41ee-8918-40d726a1a006@isocpp.org>
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::22c 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:4800
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4800>

Hi

Sorry, I've probably not been really clear. I m not asking for all
functions to implement that. And I don't say that having the answer in
the std is the best solution.
But I is hard when you want to use std classes or functions in a
context and you are not sure of their behaviour.
For instance we know that const functions imply thread safety in
c++11, this gives me good information on how I can use it for
multithreaded context. For the lock free issue, their is no clue
currently.
I might or assume that nothing is lock free or try to find out what
is. As I was looking for this information, I discovered that the
implementation of std::thread::get_id  is probably using
::pthread_self on posix OSs, still then I don't know if it is thread
safe. I can go and find out if it is. BUT for non-opened libraries
(like MS libc) I can't go and check the code. So Or there is a
documentation of that, which is not always easy to find, Or there is
something in the std that could indicate this.

For instance, the atomic types have the method to know if the
atomicity is lockfree or not, therefor I thought it might be
interesting for several functions to have this info in a trait because
it will depend on the implementation.

I was talking about more general purpose of this approach just to know
if the idea of traits is a good one or not.
Thank you for the feedbacks.

Again this is just an idea to make it easier to use the std, in some cases

On 30 May 2013 13:29, Jonathan Wakely <cxx@kayari.org> wrote:
> So you're asking for standard library implementors to provide the answer for
> every function in the std::lib (I would object strongly to being required to
> do that) and that would only help for functions in namespace std, it
> wouldn't give you an answer for system functions not defined by the C++
> standard e.g. POSIX functions such as ::usleep() and ::pthread_self(), and
> even if you convince ever C and OS library vendor to implement it, that
> wouldn't help for third-party libraries such as X toolkits or OpenGL
> libraries or Boost libraries or the thousands of other libraries.  So would
> it actually be useful?  It seems like it would be easier for you to just do
> some homework to find out if the functions you need to use are lock-free on
> the platforms you actually use, instead of pushing the work into the
> standard.
>
>
>
> --
>
> ---
> 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.



.
