Boost logo

Boost :

From: Sergei Politov (spolitov_at_[hidden])
Date: 2008-07-09 10:33:22


Hi,

  I have found the following problem with message_queue on win32 (MSVC 2008
+ Windows Vista).
  Suppose we have 2 processes, one sends messages to queue, another reads
them.
  When reading process dies (for instance using End process) during
message_queue.receive the another process hangs in send.
  As I found during investigation, it tries to lock interprocess mutex, but
it is already locked by dead process.
  So this message queue instance becomes unusable.

  I attached the example.
  Steps to reproduce:
  1) Start "mq.exe s" (i.e. with argument s)
      It outs:
         sender: $PID
  2) Start mq.exe without arguments.
      It outs:
         receiver: $PID
         0
         1
         2
         3
         4
     This time sender outs:
         send done:
   3) At this point the message queue is empty and receiver waits for
messages. End it with Task Manager.
   4) Enter some number in sender console and press Enter.
   5) The sender hangs in message_queue.send

Best Regards,
  Sergei




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