Is it possible to use mutex in multiprocessing case on Linux/UNIX ?

后端 未结 5 881
[愿得一人]
[愿得一人] 2020-11-27 03:07

This is an interview question.

Is it possible to use mutex in multiprocessing case on Linux/UNIX ?

My idea: No, different processes have separate memory s

5条回答
  •  日久生厌
    2020-11-27 03:10

    Yes, in general in Linux we have only unnamed mutexes due to which they cannot operate between processes. We need a semaphore to get over that.

    In windows, they have a concept of named mutexes which lets us use mutexes across processes.

提交回复
热议问题