From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-06-27 10:14:54
> pdimov_at_[hidden] (Peter Dimov) wrote:
> > FWIW, I actually like procedural interfaces, when they fit. There is
> > nothing inherently low-level about them. thread::id may implement the
> > handle/refcounted body idiom under the hood, or it may be a Win32
> > HANDLE. In a way, this interface is higher level, because it hides
> > more of the implementation.
> > The important difference between thread::id and FILE* is that a FILE*
> > may leak. A thread::id can never leak. It has proper value semantics,
> > so the 'thread reference' it contains will be released upon its
> > destruction; and the thread will terminate itself when it's done.
> Surely if the id is just a Win32 HANDLE then you have a leakage problem?
Sorry, I now see that what I said could be (mis)interpreted that way.
What I had in mind was a HANDLE wrapper that calls DuplicateHandle() on copy
and CloseHandle() on destruction.
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk