suggestion for process shared mutex

From: Ittay Freiman (ittay_at_qlusters.com)
Date: 07/30/03


Date: 29 Jul 2003 23:45:26 -0700

Hi,

I'm looking for a way of having a mutex shared by two independant
processes (not forks of one). I've tried using IPC semaphores, but
they cause me a lot of headache, especially managing a reference count
on them, so when the last process goes down they are destroyed (why
did they provide such a feature for shared memory, but not
semaphores??).

I can also use mmap-ed files, but then I need to create those files
somewhere and synchronize to them, which will be costly.

I'm already using shared memory. Is there a reference to someplace
that can explain how to implement a mutex in the shared memory?

Any other suggestions?

Thank you for your help,
Ittay



Relevant Pages

  • Re: [OT] Re: [RFC] atomic refcounting alternative for boost shared_ptr...
    ... I have a version of refcount that supports process-wide atomic reference counting. ... If a process commits some shared memory, and wants to only decommit it when its no longer being referenced by 'anything', it can registered it with my server process via. ... Can anybody else think of practical ways to make use of process-wide atomic reference counting in any of their "existing" applications? ...
    (comp.programming.threads)
  • Re: Design question for memory access by processes
    ... As I understand it the reference data will not be accessed ... >>overhead of even mmap() may cost the OP more. ... This is a scenerio where shared memory can be a better solution than ...
    (comp.unix.programmer)
  • Re: Tcl Threads
    ... The reference provided by Neil are about as far ... Tcl threads use shared memory and mutexes etc as part of the implementation, not part of the model exposed to Tcl scripts. ...
    (comp.lang.tcl)
  • Re: [OT] Re: [RFC] atomic refcounting alternative for boost shared_ptr...
    ... I have a version of refcount that supports process-wide atomic reference ... A thread can grab a reference to piece of shared memory that was ...
    (comp.programming.threads)
  • Re: Design question for memory access by processes
    ... These reference files essentially are ordered records ... Assuming I have enough memory, ... With shared memory you can use an initialization process to load the ...
    (comp.unix.programmer)