[cpp-threads] Revision of paper on contexts for thread-local variables
Anthony Williams
anthony at justsoftwaresolutions.co.uk
Thu Sep 24 10:54:06 BST 2009
Hi,
Please find attached a draft of N2959, which is a revision of N2907 to
try and incorporate the changes discussed in Frankfurt.
The main changes are:
* thread_local_context objects cannot have overlapping (nested) lifetimes.
* I've added a function to thread_local_context to register a function
for calling when the context is closed, *after* thread_local variables
have been destroyed. This allows safely notifying a condition variable
or other synchronization mechanism from a detached thread without
concern for cleanup of thread_local variables occuring afterwards.
* I've added some functions to std::promise and std::packaged_task to
delay making the associated futures ready until the enclosing context is
destroyed, so e.g. objects passed to promise::set_value can be destroyed
before the future is made ready.
* There is full proposed wording.
I would be grateful of any comments.
Thanks,
Anthony
--
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library | http://www.stdthread.co.uk
Just Software Solutions Ltd | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.decadentplace.org.uk/pipermail/cpp-threads/attachments/20090924/28a38bcf/attachment-0001.html>
More information about the cpp-threads
mailing list