Re: rwlocks, correctness over speed.
- From: "Attilio Rao" <attilio@xxxxxxxxxxx>
- Date: Sun, 25 Nov 2007 03:10:06 +0100
2007/11/24, Robert Watson <rwatson@xxxxxxxxxxx>:
On Sat, 24 Nov 2007, Attilio Rao wrote:
I must have missed recursion arriving then -- I'll modify uipc_usrreq.c to
set the recursion flag on the rwlock in UNIX domain sockets rather than
doing the nasty hack that was previously required. At the time, the hack
was added because it seemed recursion was not going to be added to rwlocks,
but sonewconn() behavior for listen sockets really ended up requiring it.
attilio 2007-06-26 21:31:56 UTC
FreeBSD src repository
Modified files:
sys/kern kern_rwlock.c
sys/sys _rwlock.h rwlock.h
Log:
Introduce a new rwlocks initialization function: rw_init_flags.
This is very similar to sx_init_flags: it initializes the rwlock using
special flags passed as third argument (RW_DUPOK, RW_NOPROFILE,
RW_NOWITNESS, RW_QUIET, RW_RECURSE).
Among these, the most important new feature is probabilly that rwlocks
can be acquired recursively now (for both shared and exclusive paths).
Yes, that was four months after I added rw_wowned(9) to work around the lack
of recursion support. :-) However, it looks like the man page was never
updated? It contains the following rather explicit language:
Another important property is that shared holders of rwlock can recurse,
but exclusive locks are not allowed to recurse.
Ok, fix committed.
Thanks to you and Skip for the report.
Attilio
--
Peace can only be achieved by understanding - A. Einstein
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"
- References:
- rwlocks, correctness over speed.
- From: Alfred Perlstein
- Re: rwlocks, correctness over speed.
- From: Alfred Perlstein
- Re: rwlocks, correctness over speed.
- From: Stephan Uphoff
- Re: rwlocks, correctness over speed.
- From: Alfred Perlstein
- Re: rwlocks, correctness over speed.
- From: Stephan Uphoff
- Re: rwlocks, correctness over speed.
- From: Robert Watson
- Re: rwlocks, correctness over speed.
- From: Attilio Rao
- Re: rwlocks, correctness over speed.
- From: Robert Watson
- Re: rwlocks, correctness over speed.
- From: Attilio Rao
- Re: rwlocks, correctness over speed.
- From: Robert Watson
- rwlocks, correctness over speed.
- Prev by Date: Re: rwlocks, correctness over speed.
- Next by Date: Re: sensors framework continued (architecture)
- Previous by thread: Re: rwlocks, correctness over speed.
- Next by thread: Re: rwlocks, correctness over speed.
- Index(es):
Relevant Pages
- Re: rwlocks, correctness over speed.
... set the recursion flag on the rwlock in UNIX domain sockets rather than doing
the nasty hack that was previously required. ... At the time, the hack was added because
it seemed recursion was not going to be added to rwlocks, but sonewconnbehavior for listen sockets
really ended up requiring it. ... (freebsd-arch) - Re: rwlocks, correctness over speed.
... doing the nasty hack that was previously required. ... was added because it
seemed recursion was not going to be added to rwlocks, ... but sonewconnbehavior for listen
sockets really ended up requiring it. ... This is very similar to sx_init_flags: it initializes
the rwlock using ... (freebsd-arch) - Re: rwlocks, correctness over speed.
... If a rwlock is currently locked as shared/read ... AND a thread is blocked
on it to lock it exclusively/write - then new ... I would still like to disallow recursion.
... (freebsd-arch) - Re: why does this work ?
... >This is the second time I see this posted over the last couple of days, ...
you can support this, can you support z at 100 million requiring 10 ... be any way
for a recursion failure to be "polite." ... (comp.lang.c) - remote access during runaway process
... On a remotely hosted Linux server, a developer's code went in to deep ...
recursion, and all of the services on the system became unavailable, ... requiring
a call to the hosting provider. ... (comp.os.linux.misc)