kqueue issue in multithreaded environment
kqueue issue in multithreaded environment
- Subject: kqueue issue in multithreaded environment
- From: Leonardo Bernardini <email@hidden>
- Date: Mon, 23 May 2011 09:32:26 +0000
- Importance: Normal
Hi all,
I would like to thanks anyone who can help me with this matter because I'm stuck since several days finding a solution.
I've converted a multithreaded tcp server that acts on sockets to a kqueue/kevent based design.
I've read several things online, someone states that kqueue is multithreaded supported in darwin (invoking kqueue/kevents from multiple threads listening for events on the same kqueue descriptor as well as send kevents requests from different threads), while someone says that kqueue is not multithreaded supported.
My issue happens ONLY when I need to close an FD registered in kqueue in response to a EV_EOF event, basically I end with the kernel stuck on the close() function and when I experience this, I'm even unable to kill the process using KILL -9 , sudo kill -9 or whatever else, the only solution is to reboot the machine. I've read somewhere that this may be a race condition at the kernel level, but I was not able to discover the root cause of this using gdb, I've also tried to lower my serving threads to a number of 1 , and I still experience this issue (maybe because of other threads in the software logic that sends kevent requests...I don't know at this point).
Is there someone here that may explain me the design limits of kqueue as well as a way to troubleshoots this lock condition on the close() kernel function ?
thanks a lot !
Leonardo Bernardini
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden