|
Boost : |
From: Michael Glassford (glassfordm_at_[hidden])
Date: 2004-07-28 09:53:58
Tonko Juricic wrote:
> Stefan Seefeld wrote:
>
>
>>That's often impossible: objects and threads are
>>orthogonal by nature: you don't always control what
>>thread executes your code. But as it is your code
>>that needs TLS you may have to inject TLS variables
>>in *any* thread that comes your way, and so it has >
>
> to be cleaned up in a uniform way.
>
> Let me try to understand it better. We start with the
> fact that some parts of your code can be executed by
> both boost and non-boost threads.
>
> A stumbling block in my case is understanding how can
> your code be executed by a non-boost thread unless, at
> some level, you explicitly make it possible.
>
> So, if I didn't completely miss the point, TLS cleanup
> for non-boost threads is there to spare the programmer
> from having to analyze complex scenarious and calling
> sequences which may lead to a non-boost thread
> visiting the 'unsuspecting' method on your object.
>
Not necessarily complex scenarios. To take an instance: the main thread
is one that will never be created by Boost.Threads. If your object that
uses TLS is ever called from the main thread, that would be a problem.
Mike
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk