This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Interference between instances on MS-Windows
- From: "Bob McConnell" <rvm at CBORD dot com>
- To: <cygwin at cygwin dot com>
- Date: Thu, 5 Jul 2007 10:10:36 -0400
- Subject: Interference between instances on MS-Windows
Good morning,
I have a POS emulation program written in C. It uses two threads, two
condition variables and a mutex. One thread receives from a serial port,
the other sends. The condition variables and mutex are used to create a
message queue between the two threads to pass received ACK/NAK to the
sending thread with an adjustable timeout (using code from somebody's
ex2.c I got via Google). Outgoing messages are read from a file and
responses are written into a second file. Outgoing messages average 54
bytes with 39 byte responses.
This program will send 2000 transactions in about 12 minutes at 9600
bps. This is what I normally expect. However, if I open a second
instance of bash, then run this program in both shells driving two
serial ports, it takes 24 minutes for them both to send the same 2000
transactions. I expected them to complete in the same 12 minutes. It is
as if there is some resource limitation that only one process can run at
a time. The only external resource they share is the input file which
they both open read-only.
Is this a known issue? Is there any way to prevent the two instances
from interfering with each other?
CYGWIN_NT-5.0 1.5.24(0.156/4/2) 2007-01-31 10:57
Win2K SP4
P4 3.0GHz, 1 GB RAM
Thank you,
Bob McConnell
Principal Communications Programmer
The CBORD Group, Inc.
61 Brown Road
Ithaca NY, 14850
Phone 607 257-2410
FAX 607 257-1902
Email rvm@cbord.com
Web www.cbord.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/