On Wed, Mar 06, 2002 at 03:02:08PM -0800, Aaron Bannert wrote: > I see how these will be useful with an Async I/O model, but at the moment > this read mode seems either incomplete or not useful. It seems to me like > all current uses of NONBLOCK are probably unnecessary, since there is no > other way to "wait" for data to appear other than spinning endlessly. > > The problem seems to be that we don't have a way to determine when that > bucket read would no longer block once we've already determined that > it would. I'm looking for a select()/poll() mechanism for a group of > buckets. Does this even fix into our model? If not, how were we planning > on making bucket brigades able to work with Async I/O?
apr_bucket_read(NONBLOCK) if (got_nothing) do_some_work flush_some_buffers apr_bucket_read(BLOCK) process_buckets() In other words, you could see if you have some work to do. If not, then you go off and flush out other stuff that was pending. (that is: take advantage of idle time) Once you're done with the work, then you go ahead and block to get more work. Cheers, -g -- Greg Stein, http://www.lyra.org/
