process shared mutex/cond var
Pavan Sikka <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Message-ID | <[email protected]> |
I have a bunch of simple programs to test process shared mutex/cond vars (attached as zz.tar). There is a program called store which creates the shared memory and prints its pid (the name of the shared memory block is based on the pid). The program called producer initializes the mutex/cond var in shared memory and then goes into a loop writing and broadcasting. It takes the store pid as its first argument. The program called consumer does the pthread_cond_wait thing and also takes the store pid as the first argument. The producer freezes as soon as the consumer starts. The consumer goes into an endless loop around the pthread_cond_wait since it returns immediately with no error ! Could someone please help me ? These programs work on several platforms but that does not mean they are correct. Thanks. -Pavan
zz.tar
(application/octet-stream, 30 KB) - not displayed