Re: [patch] Add a writer prior lock methord for rwlock

From: Liu Tao
Date: Wed Aug 04 2004 - 05:30:07 EST


Arjan van de Ven wrote:

On Wed, 2004-08-04 at 11:09, Liu Tao wrote:


The patch adds the write_forcelock() methord, which has higher priority than
read_lock() and write_lock(). The original read_lock() and write_lock() is not
touched, and the unlock methord is still write_unlock();
The patch gives implemention on i386, for kernel 2.6.7.



can you please elaborate what kind of usage scenarios this would be
useful ? It would be nice to know what this is for ;)



write_forcelock() should be used to avoid readers starve writers, or for writers
to update shared data as far as possiable, since it prevents new readers acquire
the lock while it's waiting for existing readers release their locks. I'm not clear
who will need it now, since it doesn't affect the original read_lock() and write_lock()
I tried it.

Regards
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/