delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/05/10:59:32

X-Spam-Check-By: sourceware.org
Date: Thu, 5 Jul 2007 10:59:16 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Interference between instances on MS-Windows
Message-ID: <20070705145916.GA27040@ednor>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <FF8482A96323694490C194BABEAC24A0012364D9 AT Email DOT cbord DOT com>
MIME-Version: 1.0
In-Reply-To: <FF8482A96323694490C194BABEAC24A0012364D9@Email.cbord.com>
User-Agent: Mutt/1.5.15 (2007-04-06)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Thu, Jul 05, 2007 at 10:10:36AM -0400, Bob McConnell wrote:
>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?

You need to think about this as if someone was reporting a problem to
you.  I suspect that if that was the case, a two paragraph overview of
the problem with suppositions about what the problem might be would not
suffice.

You can start here: http://cygwin.com/problems.html but please don't
just take this, as most people do, as a subtle hint that you need to
provide cygcheck output.  Instead, take it as an opportunity to think
about what you are reporting and what kind of information a technical
person would want to see if they were going to help you with a problem.
For instance, a test case showing the problem would be useful.  You also
might want to think about instrumenting your program to see where the
slowdowns are occuring.

To answer as much of the question as I can: No, we don't impose resource
limitations on threads or processes.

cgf

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019