gcc - Is the C function select thread safe??

trefor.2.edwards@bt.com trefor.2.edwards@bt.com
Fri Jul 19 16:54:00 GMT 2013

I have a very recent version of Cygwin (see cygcheck.out attached) and an test application (attached) which has been extracted from the SIPP application. 

What it does in a loop is

*         Creates a thread

*         	In the thread: Calls "select" to wait for just under 1 second the exits the thread

*         Waits for the thread to exit.

And every time it goes around the loop, according to windows task manager, it one more handle is being used. 

If the call to "select" is removed, and a sleep of 1 is put in the loop, then it doesn't leak handles.

Hence my question, is "select" thread safe?

Trefor Edwards 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130719/f02d7f19/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 38007 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20130719/f02d7f19/attachment.obj>
-------------- next part --------------
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list