From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2001-08-14 14:47:16
> The tss concept is undergoing a lot of work at the moment.
> currently exists is likely to become an implementation detail in the
> detail namespace with an easier to use template wrapping it. I'm
> puzzling over a few things in this approach, however. Your code
> above seems to indicate that the data is automagically allocated for
> you the first time you access it and deleted when the thread ends.
> This brings up two issues. The first is that the creation requires
> default initialization semantics, which will exclude many types from
> being (directly) usable as thread specific storage.
No, ideally I will be able to provide constructor arguments when I
declare my TSS object:
Foo( const std::string &s, int i );
boost::thread_specific<Foo> bob( "Bob", 3 );
This would call Foo("Bob",3) to provide an initial value for bob for
every new thread, and of course would clean up when threads terminate.
>As for the name... suggest something better. I'm very open to
>renaming this one.
I think I just did make a suggestion. ;-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk