Topic: Library support for native_handle and std::this_thread
Author: Nicholas Pezolano <npezolano@gmail.com>
Date: Sun, 28 Apr 2013 10:55:44 -0700 (PDT)
Raw View
------=_Part_138_26919626.1367171744830
Content-Type: text/plain; charset=ISO-8859-1
Is it possible to add support to return the native_handle() from instead a
thread's function via std::this_thread?
for example
void foo(){
auto native = std::this_thread::get_id().native_handle();
// auto_native = std::this_thread::native_handle();}
--
---
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.
------=_Part_138_26919626.1367171744830
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Is it possible to add support to return the native_handle() from instead a =
thread's function via std::this_thread?<div><br></div><div>for example</div=
><div><br></div><div><pre class=3D"lang-cpp prettyprint prettyprinted" styl=
e=3D"margin-bottom: 10px; padding: 5px; font-size: 14px; background-color: =
rgb(238, 238, 238); font-family: Consolas, Menlo, Monaco, 'Lucida Console',=
'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courie=
r New', monospace, serif; overflow: auto; width: auto; max-height: 600px; c=
olor: rgb(0, 0, 0); line-height: 18px; text-align: left; "><code style=3D"f=
ont-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', '=
DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, se=
rif; "><span class=3D"kwd" style=3D"background-color: transparent; color: r=
gb(0, 0, 139); ">void</span><span class=3D"pln" style=3D"background-color: =
transparent; "> foo</span><span class=3D"pun" style=3D"background-color: tr=
ansparent; ">()</span><span class=3D"pln" style=3D"background-color: transp=
arent; ">
</span><span class=3D"pun" style=3D"background-color: transparent; ">{</spa=
n><span class=3D"pln" style=3D"background-color: transparent; ">
</span><span class=3D"kwd" style=3D"background-color: transparent; colo=
r: rgb(0, 0, 139); ">auto</span><span class=3D"pln" style=3D"background-col=
or: transparent; "> native </span><span class=3D"pun" style=3D"background-c=
olor: transparent; ">=3D</span><span class=3D"pln" style=3D"background-colo=
r: transparent; "> std</span><span class=3D"pun" style=3D"background-color:=
transparent; ">::</span><span class=3D"pln" style=3D"background-color: tra=
nsparent; ">this_thread</span><span class=3D"pun" style=3D"background-color=
: transparent; ">::</span><span class=3D"pln" style=3D"background-color: tr=
ansparent; ">get_id</span><span class=3D"pun" style=3D"background-color: tr=
ansparent; ">().</span><span class=3D"pln" style=3D"background-color: trans=
parent; ">native_handle</span><span class=3D"pun" style=3D"background-color=
: transparent; ">();</span><span class=3D"pln" style=3D"background-color: t=
ransparent; ">
//</span><span class=3D"com" style=3D"background-color: transparent; co=
lor: gray; "> auto_native =3D std::this_thread::native_handle();</span><spa=
n class=3D"pln" style=3D"background-color: transparent; ">
</span><span class=3D"pun" style=3D"background-color: transparent; ">}</spa=
n></code></pre></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_138_26919626.1367171744830--
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sun, 28 Apr 2013 21:02:38 +0200
Raw View
This is a multi-part message in MIME format.
--------------090900010102040404070602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Le 28/04/13 19:55, Nicholas Pezolano a =E9crit :
> Is it possible to add support to return the native_handle() from=20
> instead a thread's function via std::this_thread?
>
> for example
>
> |void foo()
> {
> auto native=3D std::this_thread::get_id().native_handle();
> // auto_native =3D std::this_thread::native_handle();
> }|
>
Only the owner of the thread having access to the std::thread instance=20
should have access to this function.
What would you like to do with it from the running thread?
Vicente
--=20
---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.
--------------090900010102040404070602
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3DISO-8859-1"
http-equiv=3D"Content-Type">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">Le 28/04/13 19:55, Nicholas Pezolano a
écrit :<br>
</div>
<blockquote
cite=3D"mid:0bd54f8b-bff6-42be-9553-9af64238a6c8@isocpp.org"
type=3D"cite">Is it possible to add support to return the
native_handle() from instead a thread's function via
std::this_thread?
<div><br>
</div>
<div>for example</div>
<div><br>
</div>
<div>
<pre class=3D"lang-cpp prettyprint prettyprinted" style=3D"margin-b=
ottom: 10px; padding: 5px; font-size: 14px; background-color: rgb(238, 238,=
238); font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation =
Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monos=
pace, serif; overflow: auto; width: auto; max-height: 600px; color: rgb(0, =
0, 0); line-height: 18px; text-align: left; "><code style=3D"font-family: C=
onsolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans M=
ono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; "><span =
class=3D"kwd" style=3D"background-color: transparent; color: rgb(0, 0, 139)=
; ">void</span><span class=3D"pln" style=3D"background-color: transparent; =
"> foo</span><span class=3D"pun" style=3D"background-color: transparent; ">=
()</span><span class=3D"pln" style=3D"background-color: transparent; ">
</span><span class=3D"pun" style=3D"background-color: transparent; ">{</spa=
n><span class=3D"pln" style=3D"background-color: transparent; ">
</span><span class=3D"kwd" style=3D"background-color: transparent; colo=
r: rgb(0, 0, 139); ">auto</span><span class=3D"pln" style=3D"background-col=
or: transparent; "> native </span><span class=3D"pun" style=3D"background-c=
olor: transparent; ">=3D</span><span class=3D"pln" style=3D"background-colo=
r: transparent; "> std</span><span class=3D"pun" style=3D"background-color:=
transparent; ">::</span><span class=3D"pln" style=3D"background-color: tra=
nsparent; ">this_thread</span><span class=3D"pun" style=3D"background-color=
: transparent; ">::</span><span class=3D"pln" style=3D"background-color: tr=
ansparent; ">get_id</span><span class=3D"pun" style=3D"background-color: tr=
ansparent; ">().</span><span class=3D"pln" style=3D"background-color: trans=
parent; ">native_handle</span><span class=3D"pun" style=3D"background-color=
: transparent; ">();</span><span class=3D"pln" style=3D"background-color: t=
ransparent; ">
//</span><span class=3D"com" style=3D"background-color: transparent; co=
lor: gray; "> auto_native =3D std::this_thread::native_handle();</span><spa=
n class=3D"pln" style=3D"background-color: transparent; ">
</span><span class=3D"pun" style=3D"background-color: transparent; ">}</spa=
n></code></pre>
</div>
<br>
</blockquote>
Only the owner of the thread having access to the std::thread
instance should have access to this function. <br>
<br>
What would you like to do with it from the running thread?<br>
<br>
Vicente<br>
</body>
</html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--------------090900010102040404070602--
.
Author: Nicholas Pezolano <npezolano@gmail.com>
Date: Sun, 28 Apr 2013 15:54:50 -0700 (PDT)
Raw View
------=_Part_483_24582511.1367189690281
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I would like for certain cross-platform tasks to be made easier.
On posix systems, you can call pthread_self(); and widows=20
GetCurrentThread(); to return the native_handle. but I would think=20
something like this should be provided by the standard.
Heres the stackoverflow post that pointed me=20
here, http://stackoverflow.com/questions/16259257/c11-native-handle-is-not-=
a-member-of-stdthis-thread
On Sunday, April 28, 2013 3:02:38 PM UTC-4, Vicente J. Botet Escriba wrote:
>
> Le 28/04/13 19:55, Nicholas Pezolano a =E9crit :
> =20
> Is it possible to add support to return the native_handle() from instead =
a=20
> thread's function via std::this_thread?=20
>
> for example
>
> void foo(){
> auto native =3D std::this_thread::get_id().native_handle();
> // auto_native =3D std::this_thread::native_handle();}
>
> =20
> Only the owner of the thread having access to the std::thread instance=
=20
> should have access to this function.=20
>
> What would you like to do with it from the running thread?
>
> Vicente
> =20
--=20
---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.
------=_Part_483_24582511.1367189690281
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I would like for certain cross-platform tasks to be made easier.<div><br></=
div><div>On posix systems, you can call pthread_self(); and wid=
ows GetCurrentThread(); to return the native_handle. but I would=
think something like this should be provided by the standard.</div><div><b=
r></div><div><div>Heres the stackoverflow post that pointed me here, h=
ttp://stackoverflow.com/questions/16259257/c11-native-handle-is-not-a-membe=
r-of-stdthis-thread</div></div><div><br></div><div><br>On Sunday, April 28,=
2013 3:02:38 PM UTC-4, Vicente J. Botet Escriba wrote:<blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
<div>Le 28/04/13 19:55, Nicholas Pezolano a
=E9crit :<br>
</div>
<blockquote type=3D"cite">Is it possible to add support to return the
native_handle() from instead a thread's function via
std::this_thread?
<div><br>
</div>
<div>for example</div>
<div><br>
</div>
<div>
<pre style=3D"margin-bottom:10px;padding:5px;font-size:14px;backgro=
und-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,'Lucida Consol=
e','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier=
New',monospace,serif;overflow:auto;width:auto;max-height:600px;color:rgb(0=
,0,0);line-height:18px;text-align:left"><code style=3D"font-family:Consolas=
,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstr=
eam Vera Sans Mono','Courier New',monospace,serif"><span style=3D"backgroun=
d-color:transparent;color:rgb(0,0,139)">void</span><span style=3D"backgroun=
d-color:transparent"> foo</span><span style=3D"background-color:transparent=
">()</span><span style=3D"background-color:transparent">
</span><span style=3D"background-color:transparent">{</span><span style=3D"=
background-color:transparent">
</span><span style=3D"background-color:transparent;color:rgb(0,0,139)">=
auto</span><span style=3D"background-color:transparent"> native </span><spa=
n style=3D"background-color:transparent">=3D</span><span style=3D"backgroun=
d-color:transparent"> std</span><span style=3D"background-color:transparent=
">::</span><span style=3D"background-color:transparent">this_thread</span><=
span style=3D"background-color:transparent">::</span><span style=3D"backgro=
und-color:transparent">get_id</span><span style=3D"background-color:transpa=
rent">().</span><span style=3D"background-color:transparent">nat<wbr>ive_ha=
ndle</span><span style=3D"background-color:transparent">();</span><span sty=
le=3D"background-color:transparent">
//</span><span style=3D"background-color:transparent;color:gray"> auto_=
native =3D std::this_thread::native_<wbr>handle();</span><span style=3D"bac=
kground-color:transparent">
</span><span style=3D"background-color:transparent">}</span></code></pre>
</div>
<br>
</blockquote>
Only the owner of the thread having access to the std::thread
instance should have access to this function. <br>
<br>
What would you like to do with it from the running thread?<br>
<br>
Vicente<br>
</div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_483_24582511.1367189690281--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Sun, 28 Apr 2013 18:14:51 -0700 (PDT)
Raw View
------=_Part_3490_21829254.1367198091616
Content-Type: text/plain; charset=ISO-8859-1
On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrote:
>
> I would like for certain cross-platform tasks to be made easier.
>
> On posix systems, you can call pthread_self(); and widows
> GetCurrentThread(); to return the native_handle. but I would think
> something like this should be provided by the standard.
>
> Heres the stackoverflow post that pointed me here,
> http://stackoverflow.com/questions/16259257/c11-native-handle-is-not-a-member-of-stdthis-thread
>
>
He's asking what it is you want to *do *with that native thread handle.
What are you trying to accomplish that you *need* the handle for the
current thread?
--
---
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.
------=_Part_3490_21829254.1367198091616
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;">I would like for certain cros=
s-platform tasks to be made easier.<div><br></div><div>On posix systems, yo=
u can call pthread_self(); and widows GetCurrentThread(); =
to return the native_handle. but I would think something like this sh=
ould be provided by the standard.</div><div><br></div><div><div>Heres the s=
tackoverflow post that pointed me here, <a href=3D"http://stackoverflo=
w.com/questions/16259257/c11-native-handle-is-not-a-member-of-stdthis-threa=
d" target=3D"_blank">http://stackoverflow.<wbr>com/questions/16259257/c11-<=
wbr>native-handle-is-not-a-member-<wbr>of-stdthis-thread</a></div></div><br=
></blockquote><div><br>He's asking what it is you want to <i>do </i>with th=
at native thread handle. What are you trying to accomplish that you <i>need=
</i> the handle for the current thread? <br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_3490_21829254.1367198091616--
.
Author: Lawrence Crowl <crowl@googlers.com>
Date: Mon, 29 Apr 2013 11:52:43 -0700
Raw View
On 4/28/13, Nicol Bolas <jmckesson@gmail.com> wrote:
> On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrote:
> > I would like for certain cross-platform tasks to be made easier.
> >
> > On posix systems, you can call pthread_self(); and widows
> > GetCurrentThread(); to return the native_handle. but I would
> > think something like this should be provided by the standard.
> >
> > Heres the stackoverflow post that pointed me here,
> > http://stackoverflow.com/questions/16259257/c11-native-handle-is-not-a-member-of-stdthis-thread
>
> He's asking what it is you want to *do *with that native thread
> handle. What are you trying to accomplish that you *need* the
> handle for the current thread?
If you are writing system-specific code, you can use an OS function
to get the thread handle. So, how much code you would write that
needs a native_handle function that also is not system-specific?
If it is not common, do we really need to standardize the mechanism
used to get the handle?
--
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.
.
Author: the.bernst@gmail.com
Date: Thu, 13 Feb 2014 21:35:47 -0800 (PST)
Raw View
------=_Part_12_7978197.1392356147092
Content-Type: text/plain; charset=UTF-8
Um, what do you think the rest of the C++11 std::thread wraps around?
System-specific code. This is what wrappers are for, and part of why the
std library exists in the first place.
-Brian
On Monday, April 29, 2013 12:52:43 PM UTC-6, Lawrence Crowl wrote:
>
> On 4/28/13, Nicol Bolas <jmck...@gmail.com <javascript:>> wrote:
> > On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrote:
> > > I would like for certain cross-platform tasks to be made easier.
> > >
> > > On posix systems, you can call pthread_self(); and widows
> > > GetCurrentThread(); to return the native_handle. but I would
> > > think something like this should be provided by the standard.
> > >
> > > Heres the stackoverflow post that pointed me here,
> > >
> http://stackoverflow.com/questions/16259257/c11-native-handle-is-not-a-member-of-stdthis-thread
> >
> > He's asking what it is you want to *do *with that native thread
> > handle. What are you trying to accomplish that you *need* the
> > handle for the current thread?
>
> If you are writing system-specific code, you can use an OS function
> to get the thread handle. So, how much code you would write that
> needs a native_handle function that also is not system-specific?
> If it is not common, do we really need to standardize the mechanism
> used to get the handle?
>
> --
> 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/.
------=_Part_12_7978197.1392356147092
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Um, what do you think the rest of the C++11 std::thread wr=
aps around? System-specific code. This is what wrappers are for, and =
part of why the std library exists in the first place.<br><br>-Brian<br><br=
>On Monday, April 29, 2013 12:52:43 PM UTC-6, Lawrence Crowl wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left=
: 1px #ccc solid;padding-left: 1ex;">On 4/28/13, Nicol Bolas <<a href=3D=
"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"s492feWIpXsJ" onmo=
usedown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
javascript:';return true;">jmck...@gmail.com</a>> wrote:
<br>> On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrot=
e:
<br>> > I would like for certain cross-platform tasks to be made easi=
er.
<br>> >
<br>> > On posix systems, you can call pthread_self(); and widows
<br>> > GetCurrentThread(); to return the native_handle. but I =
would
<br>> > think something like this should be provided by the standard.
<br>> >
<br>> > Heres the stackoverflow post that pointed me here,
<br>> > <a href=3D"http://stackoverflow.com/questions/16259257/c11-na=
tive-handle-is-not-a-member-of-stdthis-thread" target=3D"_blank" onmousedow=
n=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.=
com%2Fquestions%2F16259257%2Fc11-native-handle-is-not-a-member-of-stdthis-t=
hread\46sa\75D\46sntz\0751\46usg\75AFQjCNE_jzwWC-HP4gj3KAz_KiNUufGJcQ';retu=
rn true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%=
2Fstackoverflow.com%2Fquestions%2F16259257%2Fc11-native-handle-is-not-a-mem=
ber-of-stdthis-thread\46sa\75D\46sntz\0751\46usg\75AFQjCNE_jzwWC-HP4gj3KAz_=
KiNUufGJcQ';return true;">http://stackoverflow.com/<wbr>questions/16259257/=
c11-native-<wbr>handle-is-not-a-member-of-<wbr>stdthis-thread</a>
<br>>
<br>> He's asking what it is you want to *do *with that native thread
<br>> handle. What are you trying to accomplish that you *need* th=
e
<br>> handle for the current thread?
<br>
<br>If you are writing system-specific code, you can use an OS function
<br>to get the thread handle. So, how much code you would write that
<br>needs a native_handle function that also is not system-specific?
<br>If it is not common, do we really need to standardize the mechanism
<br>used to get the handle?
<br>
<br>--=20
<br>Lawrence Crowl
<br></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_12_7978197.1392356147092--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Fri, 14 Feb 2014 11:53:55 -0800 (PST)
Raw View
------=_Part_983_25602684.1392407636010
Content-Type: text/plain; charset=UTF-8
On Monday, April 29, 2013 11:52:43 AM UTC-7, Lawrence Crowl wrote:
>
> On 4/28/13, Nicol Bolas <jmck...@gmail.com <javascript:>> wrote:
> > On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrote:
> > > I would like for certain cross-platform tasks to be made easier.
> > >
> > > On posix systems, you can call pthread_self(); and widows
> > > GetCurrentThread(); to return the native_handle. but I would
> > > think something like this should be provided by the standard.
> >
> > He's asking what it is you want to *do *with that native thread
> > handle. What are you trying to accomplish that you *need* the
> > handle for the current thread?
>
> If you are writing system-specific code, you can use an OS function
> to get the thread handle. So, how much code you would write that
> needs a native_handle function that also is not system-specific?
> If it is not common, do we really need to standardize the mechanism
> used to get the handle?
>
There are non-standard cross-platform libraries that already take a
platform-specific thread handle. It could be transparent to integrate
these with C++11 if you could get the platform-specific thread handle.
I'm actually dealing with this right now (can't go over specifics due to
NDAs). The library lets you set some debug information on a thread. The
function to set that info needs the platform thread handle (it uses
whatever the native handle is in Windows, POSIX, WiiU, Xbox, Playstation,
etc.). The only way to get that handle is using the OS-specific functions,
which is silly if you're otherwise using C++11 functionality everywhere (or
everywhere a complete C++11 library is available, anyway). It just means
you end up having two layers (C++11 and the third-party library) that are
agnostic to the platform and then a need to write some platform-specific
layer just to glue them together.
--
---
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/.
------=_Part_983_25602684.1392407636010
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, April 29, 2013 11:52:43 AM UTC-7, Lawrence Crow=
l wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 4/28/13, Nicol Bola=
s <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"s4=
92feWIpXsJ" onmousedown=3D"this.href=3D'javascript:';return true;" onclick=
=3D"this.href=3D'javascript:';return true;">jmck...@gmail.com</a>> wrote=
:
<br>> On Sunday, April 28, 2013 3:54:50 PM UTC-7, Nicholas Pezolano wrot=
e:
<br>> > I would like for certain cross-platform tasks to be made easi=
er.
<br>> >
<br>> > On posix systems, you can call pthread_self(); and widows
<br>> > GetCurrentThread(); to return the native_handle. but I =
would
<br>> > think something like this should be provided by the standard.
<br>>
<br>> He's asking what it is you want to *do *with that native thread
<br>> handle. What are you trying to accomplish that you *need* th=
e
<br>> handle for the current thread?
<br>
<br>If you are writing system-specific code, you can use an OS function
<br>to get the thread handle. So, how much code you would write that
<br>needs a native_handle function that also is not system-specific?
<br>If it is not common, do we really need to standardize the mechanism
<br>used to get the handle?
<br></blockquote><div><br></div><div>There are non-standard cross-platform =
libraries that already take a platform-specific thread handle. It cou=
ld be transparent to integrate these with C++11 if you could get the platfo=
rm-specific thread handle.</div><div><br></div><div>I'm actually dealing wi=
th this right now (can't go over specifics due to NDAs). The library =
lets you set some debug information on a thread. The function to set =
that info needs the platform thread handle (it uses whatever the native han=
dle is in Windows, POSIX, WiiU, Xbox, Playstation, etc.). The only wa=
y to get that handle is using the OS-specific functions, which is silly if =
you're otherwise using C++11 functionality everywhere (or everywhere a comp=
lete C++11 library is available, anyway). It just means you end up ha=
ving two layers (C++11 and the third-party library) that are agnostic to th=
e platform and then a need to write some platform-specific layer just to gl=
ue them together.</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_983_25602684.1392407636010--
.