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 Dave Korn
> Sent: Thursday, July 05, 2007 11:48 AM
> To: cygwin@cygwin.com
> Subject: RE: Interference between instances on MS-Windows
> 
> On 05 July 2007 16:33, Bob McConnell wrote:
> 
> 
> > 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.
> 
>   Well yeh, but there might be /unknown/ problems in the 
> pthreads code, which
> we'd love to fix if we knew they were there.

Silly me, it looks like the sample code I found from a Google search
will do nicely as a test case.

From my own tests, I found that if I eliminate the message queue and
simply sleep more than enough time to get the ACK from the host, two
instances would run in the same time as a single instance. When I use
the queue, two instances take twice as long. Sometime this morning, the
light bulb came on. I added an elapsed time calculation to the example I
copied the queue from and increased the iteration count by an order of
magnitude to make it run long enough to make a difference. A single
instance will complete in 18 seconds. Two instances take 36 seconds.
(Actually, one falls somewhere in between, but the other always takes
36.)

I have attached that code with the timers.

Compile command: gcc -o ex2 ex2b.c -Wall<Enter>

System:
  CYGWIN_NT-5.0 1.5.24(0.156/4/2) 2007-01-31 10:57
  Win2K SP4
  P4 3.0GHz, 1 GB RAM

Any suggestions would be appreciated.

Bob McConnell

Attachment: ex2b.c
Description: ex2b.c

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