X-Spam-Check-By: sourceware.org Date: Thu, 5 Jul 2007 10:59:16 -0400 From: Christopher Faylor 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: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-06) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/