How do I synchronize access to shared memory in LynxOS/POSIX?
Posted
by GrahamS
on Stack Overflow
See other posts from Stack Overflow
or by GrahamS
Published on 2010-04-06T12:15:19Z
Indexed on
2010/04/06
12:33 UTC
Read the original article
Hit count: 388
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?
© Stack Overflow or respective owner