gcc - Is the C function select thread safe??

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gcc - Is the C function select thread safe??

Trefor
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?

Regards
Trefor Edwards

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

test.c (2K) Download Attachment
cygcheck.out (51K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gcc - Is the C function select thread safe??

Christopher Faylor-8
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: gcc - Is the C function select thread safe??

Trefor
Snapshot tried successfully.. Magic!