Boost logo

Boost :

From: Andrey Semashev (andysem_at_[hidden])
Date: 2007-02-05 17:04:11


Hello Steven,

Tuesday, February 6, 2007, 12:25:35 AM, you wrote:

> AMDG

> Andreas Huber <ahd6974-spamgroupstrap <at> yahoo.com> writes:

>>
>> I guess so if you want to make it easy for the users. Another option
>> would be to require them to call a static initialize function from
>> main() before they start any additional threads.
>>

> That is not a good idea in this case.
> 1) Each instantiation of the template would need it's own initialize function.

Not necessarily. The Standard requires _any_ function to be called
from the TU to execute dynamic initialization.

> 2) It is not safe to use a state_machine during the dynamic initialization phase.

I was thinking about some functions that are executed automatically on
module load (see __attribute__((constructor)) in GCC, for example).
That might free users from calling such function.

-- 
Best regards,
 Andrey                            mailto:andysem_at_[hidden]

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