On May 15, 2008, at 4:17 PM, Jens Alfke wrote:

You can wire up kqueues to a runloop fairly easily. Instead of blocking, the kqueue will post an event to the runloop when something happens. Then instead of waiting in kevent, you just handle events in your runloop, and your callback will be invoked as necessary.

That's interesting... Although I think for now, having kevent in a separate thread is working okay. When it gets a request, it locks a shared NSMutableArray queue and sets an NSConditionLock indicating that a worker thread should copy and clear the queue and then process the requests... It seems to be working very well.

(My advice: unless you're seriously trying to write The Fastest Web Server In The World, use NSStream and/or CFNetwork and follow their asynchronous/runloop model.)

It's not that I'm trying to write The Fastest Web Server In The World, it's just that I'm trying to squeeze every dollar out of my server hardware. Besides, if I'm writing something from scratch, why not make it scream? :)

- ben

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to