Timo Sirainen writes:
On Wed, 2003-07-16 at 06:16, Mark Crispin wrote:
One way to avoid this is to make the flag list be a single token. For example, represent the flags as bit vectors which are updated in a single write operation. The system flags are 6 bits, and if you allow up to 26 keyword flags you can fit the entire thing in a 32-bit word.

This gives you atomicity without having to worry about these cases.

That is actually what I was going to do. I'm just not so sure that a single write() operation is always atomic for more than one byte.

It may not be. But that doesn't matter - whatever funny effects you may have are indistinguishable from another client setting the flags at the same time.


--Arnt

Reply via email to