Multithreaded accept/connect locks
wtk25@drexel.edu
wtk25@drexel.edu
Tue Jun 26 20:39:00 GMT 2007
I'm trying to test some socket code inside a single process. I have two threads, a server and a client, and try to connect a Unix domain socket between them, but the threads block on accept() and connect() respectively. I've tried blocking on select() so that the accept() does not block, with the same results. When the server and client are forked into different processes, the connection works fine.
This problem seems similar to that reported in
http://cygwin.com/ml/cygwin-developers/2003-02/msg00064.html
except that my sockets are Unix domain, so my connecting socket should be looking in the right place.
However, that thread is pretty old, and I'm running a more recent version of Cygwin.
The problem is also possibly related to
http://www.nntp.perl.org/group/perl.ithreads/2007/01/msg1142.html
Although I don't know any perl, so maybe not.
My guess is accept() and connect() share some process scope internal lock.
As a sanity check, I've attached a successful run on Ubuntu.
I've also attached the output from
$ cygcheck -s -v -r > cygcheck.out
Thanks for your time,
Trevor King
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin_run.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070626/15f5b703/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ubuntu_run.txt
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070626/15f5b703/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_cs2.c
Type: application/octet-stream
Size: 4995 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070626/15f5b703/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 52948 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20070626/15f5b703/attachment-0001.obj>
-------------- next part --------------
--
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/
More information about the Cygwin
mailing list