Blog Archive for / 2010 / 05 /
Enforcing Correct Mutex Usage with Synchronized Values
Friday, 28 May 2010
My latest article, Enforcing Correct Mutex Usage with Synchronized Values has been published on the Dr Dobb's website.
This article expands on the SynchronizedValue<T>
template I mentioned in my presentation
on Concurrency
in the Real World at ACCU 2010, and deals with the problem of
ensuring that the mutex associated with some data is locked whenever
the data is accessed.
The basic idea is that you
use SynchronizedValue<T>
wherever you have
an object of type T
that you wish to be protected with
its own mutex. The SynchronizedValue<T>
then
behaves like a pointer-to-T
for simple uses.
Read the article for the full details.
Posted by Anthony Williams
[/ news /] permanent link
Tags: mutex, cplusplus
Stumble It! | Submit to Reddit
| Submit to DZone
If you liked this post, why not subscribe to the RSS feed or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.
just::thread C++0x Thread Library V1.4 (FCD Edition) Released
Thursday, 06 May 2010
I am pleased to announce that version 1.4 (the FCD edition)
of just::thread
,
our C++0x Thread Library
has just been released.
With the release of the "FCD edition", just::thread
provides the first complete implementation of the multithreading
facilities from
the Final
Committee Draft (FCD) of the C++0x standard.
Changes include:
- New
promise::set_value_at_thread_exit
,promise::set_exception_at_thread_exit
, andpackaged_task::make_ready_at_thread_exit
member functions to defer unblocking waiting threads until the notifying thread exits -
New
notify_all_at_thread_exit function
for notifying condition variables when the notifying thread exits -
The
wait_for
andwait_until
member functions offuture
,shared_future
andatomic_future
return afuture_status
enum rather thanbool
to indicate whether the future is ready, the wait timed out, or the future contains a deferred async function - The destructor of the last future associated with an async function waits for that function to complete.
- New
ATOMIC_VAR_INIT
macro for initializing atomic objects - The callable object for a
packaged_task
is destroyed with thepackaged_task
rather than being kept alive until the future is destroyed
As usual, existing customers are entitled to a free upgrade to V1.4.0 from all earlier versions.
Posted by Anthony Williams
[/ news /] permanent link
Tags: multithreading, concurrency, C++0x
Stumble It! | Submit to Reddit
| Submit to DZone
If you liked this post, why not subscribe to the RSS feed or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.
Design and Content Copyright © 2005-2025 Just Software Solutions Ltd. All rights reserved. | Privacy Policy