X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Subject: Interference between instances on MS-Windows
Date: Thu, 5 Jul 2007 10:10:36 -0400
Message-ID: <FF8482A96323694490C194BABEAC24A0012364D9@Email.cbord.com>
From: "Bob McConnell" <rvm@CBORD.com>
To: <cygwin@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l65EBMpn018246

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/


