Boost logo

Boost :

Subject: Re: [boost] [interprocess] More robust message_queue and interprocess_condition?
From: kopo (kopinskc_at_[hidden])
Date: 2011-05-07 21:46:36


Ross MacGregor wrote:
>
> I am considering a slight modification to this solution, I will post
> it in more detail when I get time. Basically, instead of changing
> interprocess_condition we should modify the interprocess_mutex lock
> function to time out instead. The lock function could simply call
> through to timed_lock() and throw an exception if it times out. This
> would be more effective change for the library.
>

Are you proposing a modification such as:

<file>interprocess_condition.hpp</file>
inline void interprocess_condition::notify(boost::uint32_t command)
{
   //m_enter_mut.lock();
        boost::posix_time::ptime till =
boost::posix_time::microsec_clock::universal_time() +
boost::posix_time::milliseconds(1000);
        if(!m_enter_mut.timed_lock(till))
                throw interprocess_exception(lock_error);

where you would just provide a timed lock on the notify?
Possibly in a notify_timed function. Where the time to wait could be
specified in construction of the message queue.

Are you planning on submitting your proposal to the library for
consideration in the next release?

--
View this message in context: http://boost.2283326.n4.nabble.com/interprocess-message-queue-hangs-when-another-process-dies-tp2648488p3506392.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk