Re: How to kill a camping kqueue thread? Was: close() hangs … in 10.5 only
Re: How to kill a camping kqueue thread? Was: close() hangs … in 10.5 only
- Subject: Re: How to kill a camping kqueue thread? Was: close() hangs … in 10.5 only
- From: Steve Checkoway <email@hidden>
- Date: Fri, 20 Aug 2010 00:43:34 -0700
On Aug 19, 2010, at 22:56 , Jerry Krinock wrote:
Thank you, Terry. Fortunately for my feeble brain the problem was
none of the rocket science you explained, just this one:
On 2010 Aug 16, at 17:38, Terry Lambert wrote:
you have another thread camping out on the fd in kevent().
Indeed, my app operates by creating a kqueue in the main thread with
kevent(…,EV_ADD|EV_ENABLE,…), and then spinning off a new thread via
-[NSThread detachNewThreadSelector:::]. The new thread camps out on
kevent() in a loop like this:
Why not have a timeout on the kevent? If kevent returns with a
timeout, then check some state (for exmaple the isCancelled method of
NSThread) and exit if appropriate. Otherwise, loop.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden