Thread-based or event-based?
Posted Mar 1, 2007 18:22 UTC (Thu) by
bronson (subscriber, #4806)
In reply to:
Thread-based or event-based? by zooko
Parent article:
Thread-based or event-based?
That's a fascinating paper. Good find! Here's a link that worked for me: http://bcr2.uwaterloo.ca/~brecht/papers/eurosys-2007.pdf
Personally, I've found that an event-based model is great when you're doing trivial operations (say, a transparent proxy), but tends to fall apart when you're doing more complex stuff (say, a caching proxy with arbitrary, dynamic L7 rewrites). Get that state machine right on the first try! Even a small change tends to turn into a huge rippling modification if you didn't anticipate it. In my experience, avoiding state machines tends to be a win in the long run. But that's got a serious performance cost.
A hybrid scheme would be great. I have to agree with the naysayers though: in networking, everything blocks. A threadlet scheme will just wind up running as a thread-per-connection scheme. I hope the kernel guys can find a good way to work around this.
I'm happy that kevent finally got a bit of well-deserved recognition. An article comparing kqueue, epoll, kevent, and syslets/threadlets would be fascinating. I'm afraid that would be more like an academic paper, though... Anyone interested in doing a masters dissertation? :)
(
Log in to post comments)