Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-07-31 13:21:53


> > your DuplicateHandle/CloseHandle is really an
> > overkill.. keeping just ONE handle and TLS/TSD
> > key association is much more attractive/
> > efficient, IMHO.
>
> No, DuplicateHandle/CloseHandle is required. GetCurrentThread() returns
a
> psuedohandle, not a real handle.

GetCurrentThread() has nothing to do with my
point. you just keep a single copy of *REAL*
handle (and if really needed, wrapped inside
some object together with global thread
id <- GetCurrentThreadId/CreateThread(...,&id),
etc) and get access to it via TLS/TSD.

> > why not "static thread& thread::current()" ?
>
> Think of other threads that need to see that thread's handle.

go on, please.

regards,
alexander.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk