Sharing a Mutex Across Processes... Help?

Discussion in 'Programmer Misc' started by Mike, Jun 19, 2009.

  1. Mike

    Mike Guest

    I'm trying to port an application from Linux to Mac OS X that needs to
    be able to share a mutex across processes. On Linux I can do this
    easily by calling:

    pthread_mutexattr_setpshared
    (&pthreadmutexattrt,PTHREAD_PROCESS_SHARED);

    Obviously, when I tried to run with the code as is it didn't work.
    I've since found out that this is because OS X does not support
    sharing a mutex across processes.

    I'm hoping that someone out there knows a way I can do this on OS X.
    It's essential for my application. So far, I've not been able to find
    any Apple API that can do this (it appears they are all based on
    pthreads). The next closest thing I can find would be a named
    semaphore. Are they supported on all version of OS X? Or at least 10.3
    and higher?

    Also, if anyone has a better suggestion for how to do this I would
    love to hear it.

    Thanks,
    Mike
     
    Mike, Jun 19, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Newsbot
    Replies:
    0
    Views:
    492
    Newsbot
    Jun 17, 2008
  2. sandradavie

    Sharing files across different users

    sandradavie, Aug 13, 2010, in forum: Mac OS X
    Replies:
    1
    Views:
    707
    Walrus666
    Aug 14, 2010
  3. Matt Simpson

    Apache2/SSL on OS X; mutex problem?

    Matt Simpson, Oct 8, 2004, in forum: Apps
    Replies:
    5
    Views:
    487
    Dave Hinz
    Oct 11, 2004
  4. Karel Koskuba
    Replies:
    1
    Views:
    202
    clvrmnky
    May 13, 2004
  5. Herbert Viola
    Replies:
    0
    Views:
    203
    Herbert Viola
    Dec 6, 2007
  6. ric
    Replies:
    0
    Views:
    195
  7. Pete
    Replies:
    35
    Views:
    562
    Rowland McDonnell
    Mar 10, 2007
  8. apple125
    Replies:
    2
    Views:
    460
    oldscribe
    Apr 10, 2013
Loading...