Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Message-ID: <430C9C04.4020905@vihmapuu.ee>
Date: Wed, 24 Aug 2005 19:10:44 +0300
From: Raul Metsma <raul@vihmapuu.ee>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Problems with Windows threads and cygwin sleep()
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

There seems to be some kind issues with cygwin sleep()
and Windows threads.
I created one test program which creates 600 threads
with native windows Sleep(1).
Now when I compile simple c program under cygwin

while(1) { sleep(1); }

and execute it, the first program will eat 100% CPU.

It does not have any problem with Mingw compiled version.
Then I tried compile it under cygwin, using native windows
Sleep() ( Uppercase ) and included w32api/windows.h header,
then it does not have this issue.

I discovered this, using rsync. When I changed rsync sleeps,
with native versions, then there seems to be still same issue.
Maybe cygwin uses inside dll sleep?

I really hope to get this issue fixed

Raul Metsma

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

