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

From: Rik van Riel
Date: Wed Aug 04 2004 - 07:17:12 EST


On Wed, 4 Aug 2004, Liu Tao wrote:

> 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.

Looks like it should deadlock if you have multiple CPUs
trying to upgrade from a read lock to a write lock
simultaneously...

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-
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/