Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::Interprocess mutex with condition variable
From: rudasi (rahuludasi_at_[hidden])
Date: 2013-07-17 16:43:31


One issue with your solution could be having a spurious wake up
(http://vladimir_prus.blogspot.ca/2005/07/spurious-wakeups.html) after doing
nc->wait(lock);. Wrapping this wait in a while loop will prevent that from
happening. Another problem I can see is that your second process cleans up
everything before your first process wakes up as nc->notify_all(); is not a
blocking call. So the two problems I can see is that your first process
could continue after the wait as its not in a loop due to spurious wake ups
and if it does wait your second process will delete everything after the
notify_all() call as it is running under a scoped mutex and so only after
exiting from scope in process 2 will process 1 be able to claim the mutex
but by now everything is deleted.

--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-Interprocess-mutex-with-condition-variable-tp4649571p4649762.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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