Boost logo

Boost :

From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2008-05-28 08:51:28


Stefan Seefeld <seefeld_at_[hidden]> writes:

> David Abrahams wrote:
>> Seems to me that if we have "detach()," it we should be asking whether a
>> thread is "attached()," rather than "joinable()." Our documentation
>>
> Agreed.
>
>> says "if *this refers to a thread of execution..." all over it, which
>> would seem to indicate that joinable() is an important question even
>> when you're not about to join().
>>
>
> I find this phrasing a bit strange. 'thread of execution' sounds like a
> concept.
> Is the 'main' thread not a 'thread of execution' ? (And even if no
> threads are spawned at all ?)

The 'main' thread us a thread of execution, even if no other threads
have been spawned. You cannot obtain a boost::thread object that
references it though.

> If what is referred to is actually an object (as hinted to by the use of
> '*this', it should be clear by use of an appropriate (type) name
> ('thread', instead of 'thread of execution').

The *this in question refers to the boost::thread object on which a
member function is being called. A boost::thread object may reference
a thread of execution (whether running or finished), or it may not
reference anything (e.g. a default-constructed boost::thread object).

Anthony

-- 
Anthony Williams            | Just Software Solutions Ltd
Custom Software Development | http://www.justsoftwaresolutions.co.uk
Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

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