[squid-users] aufs lseek on read()

From: Michael Puckett <Michael.Puckett@dont-contact.us>
Date: Wed, 29 Sep 2004 18:41:29 -0700

I have been examining both the aufs and ufs versions of squid with truss
and have seen that the async i/o version has thousands more calls to
lseek than the non async version. On looking at the source of
squidaio_do_read() it does indeed do a lseek() followed by a read()
where the non async read doesn't seem to. This leads to 2 questions:

1. According to the man page entry, threaded implementations should not
use lseek() followed by read() as atomicity between the calls cannot be
guaranteed. It recommends using pread() instead. Is this correct?

2. Why is the lseek() necessary in the async read method but not the
blocking read method? The output of truss shows it marching through the
cache file and the lseek() appears to be a nop in the cases which have
been captured thus far.

Best regards,

-mikep

Received on Wed Sep 29 2004 - 19:42:34 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Oct 01 2004 - 12:00:03 MDT