This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Interference between instances on MS-Windows


> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com] On Behalf Of Christopher Faylor
> Sent: Thursday, July 05, 2007 10:59 AM
> To: cygwin@cygwin.com
> Subject: Re: Interference between instances on MS-Windows
> 
> 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

If I read this right, you are saying there are no reported conflicts in
pthread resources between multiple processes. That is all I wanted to
know. I don't like to waste time diagnosing known problems and then be
told much later that there is an easy workaround.

I wasn't asking anyone to debug either my code or Cygwin. All I was
asking is if there are any known threading issues in this situation. I
have no idea how you implemented pthreads, nor do I care. Just knowing
that this may be covering new ground is adequate.

Thank you,

Bob McConnell

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]