in reply to Why are people not using POE?

POE has always looked too complicated for my work. I've considered it a few times and I usually end up using Apache/mod_perl or a hand-written daemon instead.

Also, cooperative multi-tasking has significant drawbacks. All it takes is one blocking call buried deep in your code to bring the whole system to a grinding halt. I much prefer a pre-forked multi-process model like Apache uses.

-sam

Replies are listed 'Best First'.
Re^2: Why are people not using POE?
by kscaldef (Pilgrim) on Jun 10, 2005 at 18:04 UTC
    Really high-performance server applications will generally prefer cooperative multi-(task|thread)ing. You might look at http://pl.atyp.us/content/tech/servers.html for an idea of why. (Specifically the sections on context switches).

    However, of course you won't limit yourself to only a single process. Multi-(CPU|core) machines are the norm, so you have to have multiple processes (or threads) to take advantage of that. I'm not really sure how easy or hard it is to have multiple POE processes running at once, but that is what you would want to do in general, both to address the blocking issue and the multi-processor issue.

      Really high-performance server applications will generally prefer cooperative multi-(task|thread)ing.

      That statement is indefensibly broad and, in my experience, incorrect. First, I don't know of a single system which uses cooperative multi-threading (I would say there's never been one, but I'm no CS historian). In all the systems I've seen multi-threading is preemptive, not cooperative, for obvious reasons. Second "really high-performance server applications" come in so many different shapes and flavors that stating that any one technology will be "generally preferred" is just dumb.

      For my "really high-performance server applications" I use a pool of pre-forked processes, and it works quite well! That doesn't mean it's right for all tasks but it does suggest that cooperative multi-tasking might not be the undisputed king of silver bullet land!

      -sam

        A Design Framework for Highly Concurrent Systems (PDF) compares threaded and event driven servers (and their performance degradation patterns) before it goes on to explain how the authors' hybrid system can outperform either.

        I'm passing it on because it seems relevant, and I thought it was a good read.

        I don't know of a single system which uses cooperative multi-threading

        well, what happens is that "cooperative multi-threading" is not the usual name for this kind of aplications, but I am sure you will know about squid, qmail or the X server just to name a few.