httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henrik Nordström <hen...@henriknordstrom.net>
Subject Re: Is async the answer
Date Sat, 19 Jan 2008 21:14:45 GMT
fre 2008-01-18 klockan 16:17 -0500 skrev Akins, Brian:

> Paul Q and I have been kicking around the idea that even if we go to a
> completely async core, etc. that modules could mark some hooks as "blocking"
> and they would run basically how they do today. (One day, Paul, I'll
> actually think about this more...)

In the end you need a bit of mixture between the models to work out.
threads or even processes for complex processing or libraries outside
your control, and async for the basic core to keep it lightweight in
resources/request/connection.

There is quite a bit of research in programming models supporting mixed
async/threaded/tasklet scheduling without forcing the programmer to know
all details. Quite interesting reading if you haven't read those papers
yet.

For example the tame approach (C++ preprocessor using libasync) used by
OKWS and it's related cousin tamer (more lightweight library) is quite
fun to work with, at least in theory.


Regarding CPU performance then you need a more complex workload than
pure sendfile() shuffling of data to see much of a difference between
threaded or async models. Especially if you look at smaller requests
where the two almost diverge to the same model.. (N threads doing fast
successive batch processing one request at a time with no wait time, or
a event loop doing pretty much the same batching..).

Regards
Henrik

Mime
View raw message