6 ms·
There are plenty of types of locking mechanisms. A semaphore is a specific type of such. Sure, they might look different on different systems, or have different
by askvictor 4y ago
There are plenty of types of locking mechanisms. A semaphore is a specific type of such. Sure, they might look different on different systems, or have different surfaces, but all should (or at least the ones I've seen) have an integer. Unless the term has been overloaded (sigh) and it's come to mean different things.
- csdvrx 4y ago> all should (or at least the ones I've seen) have an integer. To store integers like "5" with environment variables, I use export VARIABLE=5
- askvictor 4y agoThe point of a semaphore though is that it checks the value then modifies it in an atomic operation. If you can't guarantee the operation is atomic, you haven't solved the underlying problem.