On Thu, Jan 09, 2003 at 04:47:21PM +0100, J�r�me Bolliet wrote:
> > 1. It opens and reads the courierpop3dsizelist file (if any)
> > 
> > 2. For all files which are in the mailbox but not in the cache, it works
> >    out the size as before. For all files which are in the cache but not in
> >    the directory listing, they are forgotten about.
> > 
> > 3. It then writes the updated cache to a temporary file and then does an
> >    atomic rename to 'courierpop3dsizelist'. At all instants the file is
> >    complete and valid. There is no need to lock the file. There is no
> >    race condition.
> 
> To move the temporary file, you need to delete the current 
> courierpop3dsizelist before.
> In this case, what is happen if another pop3d process try to access 
> between the delete and the move.

This is simply not true. See "man 2 rename". If you want to find out more, I
can strongly recommend the book "Advanced Programming in the Unix
Environment" (Stevens, Addison Wesley).

Even if it were true, it wouldn't matter. The other pop3d process would find
that the cache file did not exist, so would simply calculate the size of
each of the messages in the "slow" way.

Regards,

Brian.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to