Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2006-02-22 13:38:17


David Greene <greened <at> obbligato.org> writes:
> > That'll probably work, given that you use a single mutex to protect
scheduler
> > & machine. However, this is rather ugly as you end up locking two mutextes
> > whenever you queue an event.
>
> Does this imply that there's a mutex in state_machine somewhere that
> gets locked on some operations? That could definitely be problematic
> and I'll have to take extra care to avoid deadlock.

No, state_machine is not thread-safe and non-reentrant. It does not make any
calls to synchronization primitives. IIRC, the only functions that make such
calls are fifo_worker::terminate, fifo_worker::queue_work_item,
fifo_worker::operator(). So, AFAICS, deadlock should not be an issue.

Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net