Re: unlinkd <-> async-io

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 07 Sep 1998 00:09:11 +0200

Chris Wedgwood wrote:

> Fair 'nuf - but how is synchronization of the swap done then. i.e.
> one thread unlinks a file while another tried to send it to a client?

Remember: Threading in Squid is not what is normally thought as
threading. In squid the I/O operations (read(), write(), unlink(), ...)
is dispatched to threads, not the requests.

Back to your question: Swap syncronization is much the same with or
without async-io. In both cases only objects that are known to not be in
use are removed from the store and their filenames queued for removal.

Without async-io:
unlink is queued to unlinkd

With async-io:
unlink is queued to the async-io threading.

In both cases unlink is a un-acknowledged asyncronous operation (once it
is queued, it is assumed that it will happen sooner or later).

Hmm.. what about the race condition when the swap file is reused before
unlind or async-io unlinks the file? Is this dealt with?

/Henrik
Received on Tue Jul 29 2003 - 13:15:53 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:54 MST