mutex multi process sharing question

Discussion in 'C Programming' started by mazzawi@gmail.com, Nov 8, 2007.

  1. Guest

    I know they can be shared if we use
    pthread_mutexattr_setpshared with PTHREAD_PROCESS_SHARED

    but does that only work if the processes are created with a fork,
    after the mutex has been declared, ie

    pthread_mutex_t DBMutex; /* mutex id */
    fork();

    so the processes know where to find the mutex.

    but what if we have 2 indepednant processes. that are started
    separately not forked. is there a way to use the pthread_mutex, or do
    i have to use semaphores.
    , Nov 8, 2007
    #1
    1. Advertising

  2. Guest

    , Nov 8, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ian douglas
    Replies:
    2
    Views:
    970
    Randy Howard
    Jul 30, 2004
  2. NaeiKinDus
    Replies:
    1
    Views:
    558
    Jack Klein
    Apr 14, 2007
  3. NaeiKinDus
    Replies:
    3
    Views:
    589
    James Kanze
    Apr 15, 2007
  4. Gunter Henriksen
    Replies:
    13
    Views:
    1,681
    Lawrence D'Oliveiro
    May 1, 2009
  5. sven
    Replies:
    2
    Views:
    1,914
    Roy Smith
    Dec 4, 2009
Loading...

Share This Page