How do I synchronize access to shared memory in LynxOS/POSIX?
- by GrahamS
I am implementing two processes on a LynxOS SE (POSIX conformant) system that will communicate via shared memory.
One process will act as a "producer" and the other a "consumer". In a multi-threaded system my approach to this would be to use a mutex and condvar (condition variable) pair, with the consumer waiting on the condvar (with pthread_cond_wait) and the producer signalling it (with pthread_cond_signal) when the shared memory is updated.
How do I achieve this in a multi-process, rather than multi-threaded, architecture?
Is there a LynxOS/POSIX way to create a condvar/mutex pair that can be used between processes?
Or is some other synchronization mechanism more appropriate in this scenario?