|
Boost Users : |
Subject: [Boost-users] abandoned named_mutex
From: Carla Strembicke (Carla.Strembicke_at_[hidden])
Date: 2010-02-11 17:11:09
Hello,
My question is with regard to named_mutexes that are abandoned by a process that dies abnormally.
Essentially I have shared memory( utilizing boost shared memory libraries ) and am incorporating boost named mutexes to limit access to one process at a time.
There is no concept of a server/client or parent/child process....the process have equal opportunity. This is Microsoft centric code that I am required to support cross-platforms( Unix-like).
Microsoft's mutexes have the concept of a mutex object being abandoned if the thread terminates without releasing.
Is there any support in the boost mutex to determine if the mutex has been abandoned?
Option:
What I am considering is perhaps before the mutex is locked, it check a file that has been created with the mutex name and the pid of the process that has it locked.
If the process does not exisit the file the mutex is unlocked and the file entry is removed and the new process id is entered.
I am not sure if there is a chance of a race condition I would have to scope it out.
FYI - I am using 1.41. is there any changes in 1.42 ( i will be checking ).
Any other suggestions?
Carla Strembicke
Software Developer
[cid:imagea03ff0.jpg_at_eeae924c.570740bf]
SUBNET Solutions Inc.
www.SUBNET.com<http://www.subnet.com/>
Making Substations More Intelligent
T: 403.270.8885
F: 403.270.9631
#100, 4639 Manhattan Road SE, Calgary, Alberta, Canada; T2G 4B3
Follow SUBNET: Twitter<http://twitter.com/subnetsolutions> | Facebook<http://www.facebook.com/subnetsolutions> | Linkedln<http://www.linkedin.com/groups?gid=2733031&trk=hb_side_g>
Visit the all new SUBNET website at http://www.SUBNET.com CONFIDENTIAL INFORMATION NOTICE: The information contained in this e-mail is privileged, confidential and intended solely for the use of the addressee named above. If the reader of this e-mail is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you received this in error, please contact the sender and destroy all copies of this e-mail. Thank you.
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