[Dovecot] Design: Asynchronous I/O for single/multi-dbox

Frank Cusack frank+lists/dovecot at linetwo.net
Tue Mar 16 19:19:01 EET 2010


On 3/16/10 6:44 PM +0200 Timo Sirainen wrote:
> Threads are useful when you need to do CPU intensive work in parallel,
> and threads need access to shared data structures.

And when you don't want to block on I/O.  Threads are almost always
easier than AIO, and especially easy (ie, no scary complexity issues
eg deadlock) if you aren't sharing data structures.

It used to be that threads weren't scheduled well, and that if you
wanted Linux portability you should avoid them, but in the last 5
years that has changed and usu. it's the best choice now.

You mentioned locking overhead earlier, which is a red herring, but
even on Linux if you are running an SMP kernel you have the locking
"overhead" even if your process is single threaded.

-frank


More information about the dovecot mailing list