Re: libthr and 1:1 threading.

From: Peter Wemm <peter_at_wemm.org>
Date: Wed, 02 Apr 2003 16:08:16 -0800
Matthew Dillon wrote:

>     A better solution would be to give AIO the capability to
>     operate synchronously if the operation would occur in a 
>     non-blocking fashion (inclusive of blockages on page faults),
>     and asynchronously otherwise.

Without wanting to get too far off into the weeds, squid does something
interesting.  They need to be able to nonblock for everything including
open(), read(), unlink(), readdir() etc.  So what they do is implement a
fairly significant superset of the traditional AIO stuff using pthreads. It
seems to work pretty well for them, even with linuxthreads style threads.
Granted, squid's needs are not exactly typical.  But I did want to point
out that a good part of the delays come not only from data IO but operations
like opening a file (pathname traversal), creating or removing a file,
reading a directory etc.  This is a particular problem when the disk
is really busy.

Cheers,
-Peter
--
Peter Wemm - peter_at_wemm.org; peter_at_FreeBSD.org; peter_at_yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
Received on Wed Apr 02 2003 - 14:08:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:02 UTC