lkml.org 
[lkml]   [1999]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] i386 rwlock bug?
Date
> 
> Bug or feature?
> I've modified this to leave the high bit on while waiting for the
> readers to go away, thus making the high bit a 'write lock pending'
> bit. This makes sure that while the writer is waiting for the write
> lock no more readers can come in.
I think this is a feature:
rw-locks can be use partially in interrupts:
* write only from outside interrupts
* read from everywhere

if a writer spins (interupts are enabled), then an interrupt occurs,
then you have a dead-lock.

WinNT has special "acquire_shared_starve_writer()"-calls but I don't
think this is required.

> Does anyone consider the current behaviour a feature? Are there
> arguments against my patch? Agreed, there isn't always much lock
> contention, so you can say "Leave it this way." but I use rwlocks in
> 'heavy contention' situations and (for example) with 10 readers and 1
> writer the writer never acquires the write lock without this patch.
add your code as a "rw-don't-starve-lock", but I think the normal
rw_lock must starve writers.

--
Manfred

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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.083 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site