This is the mail archive of the
mailing list for the Cygwin project.
IPC and pthread condition variable bug
- From: "Sikorski Grzegorz-VBFM67" <grzegorz dot sikorski at motorolasolutions dot com>
- To: <cygwin at cygwin dot com>
- Date: Fri, 15 Apr 2011 11:48:45 +0100
- Subject: IPC and pthread condition variable bug
I have tried to build an application with queues in UNIX flavor (using msgget API). I have successfully ran cygwin server and enabled IPC. The program works if I use 2-3 queues to send messages between threads (single thread reads from one queue, multiple threads can write to any queue). Although if I try to create more than 3 queues, the application behaves very strange - some read queue operations (msgrcv without IPC_NOWAIT flag set) fail randomly (returns success even if there is no message in the queue or returns undefined errors).
I also tried to implement my own IPC, without cygwin server IPC. The code, which has been successfully tested on Solaris 5.10 platform and runs there normally, under cygwin fails randomly. I have investigated that the problem is with pthread condition variables and timedout wait: pthread_cond_wait and pthread_cond_timedwait returns undefined values (none of valid error codes). This situation occurs if I operate on many condition variables (more than 3). If I use only 3 condition variables, there is no errors and my IPC works absolutely fine.
VPM QUICC Team
Motorola Polska Electronics? Sp.z.o.o
30-381 Krakow, Poland
KRS 0000146875 - Poland
VAT No: PL6772135826
Share capital: 4,600,000 PLN?
Details of Motorola's subsidiaries in the EU/EEA can be found at: v www.motorolasolutions.com/XU-EN/About/Subsidiaries
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple