On Wed, 31 Dec 2003, Christian Kratzer wrote:
> A frequently used solution will be to use an index file or a header in
> the message store to mark messages as expunged and only rewrite the
> mailbox when an exclusive lock on it has been obtained.

Correct.

> With a maildirs like message store you could actually delete the
> messages on expunge but you would only rewrite your index file
> to reflect new sequence numbers when you get an exclusive lock
> on it.

Alternatively, have a share count in the index file along with an
"expunged" flag.  As each process that has the mailbox selected notes the
message as being expunged, decrement the share count.  When the share
count reaches zero, it is then safe to delete the message.

The update on the index file to clean up the zero-share-count expunged
message can be deferred until some process gets an exclusive lock on it.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

Reply via email to