Boost logo

Boost :

From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-06-08 09:32:28


Rob Stewart wrote:

> From: "Johan Nilsson" <johan.nilsson_at_[hidden]>
>
>>"Malcolm Noyes" <boost_at_[hidden]> wrote in message
>>
>>>IIRC, the complexity arises when you start to consider global scope
>>>thread specific variables in different translation units, together
>>>with the possibility that threads can be started before 'main' and
>>>waited on, i.e. joined, after 'main has completed. Ah, I see the
>
>
> Do you really want to account for the creation and joining of
> threads outside of main()? I'm no MT expert, but I recall
> learning that one should avoid creating threads prior to main.
> It makes statics and even main() difficult to write. Isn't
> that correct? If so, should Boost.Thread really account
> for bad designs?
>

The biggest problem with this is that global static objects are
initialized before main(). Is it necessarily a bad thing for the
constructor of such an object to create a thread?

Mike


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