Answer the question
In order to leave comments, you need to log in
How to implement inter-process locks/semaphores?
Which IPC to use to lock certain actions in a program running in different processes?
Target OS - Linux, preferably Linux + OS X.
Implementation language - Python, but cross-language locking is desirable, for example PHP + Python.
Google told me about semaphore.h/sem_open.
1. Is it a good choice?
2. A very cursory search showed me that there are no analogues in the languages above. Am I wrong?
3. There is sem_get in php, but the first parameter in it is not a string, but a number. Apparently they are not that compatible.
4. Why is it so unpopular? Crutches are constantly used, from the most common - lock files.
5. What should I do if network work is needed? Probably, there is some server with similar functionality.
Answer the question
In order to leave comments, you need to log in
Traditionally, processes in lanes use pid files. Nothing more cross-language has yet been invented like. Further, stray ala memkesh, radish and others like them, which are not always sparkling.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question