Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Apr 1997 16:54:37 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        fenyo@email.enst.fr
Cc:        freebsd-hackers@FreeBSD.org, jb@cimlogic.com.au
Subject:   Re: fd locking problem with libc_r ?
Message-ID:  <199704222354.QAA27858@phaeton.artisoft.com>
In-Reply-To: <199704222308.BAA20563@nikopol.enst.fr> from "Alex Fenyo" at Apr 23, 97 01:08:06 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Suppose you have 2 threads and a file descriptor, for instance a socket.

[ ... ]

> I wonder why is there such a read-write lock when just a write
> lock would be sufficient (and would solve the problem) ???
> Perhaps it's because a write lock wouldn't be sufficient ???
> (I can't find a reason for that ?)

It's because only one blocking operation can be outstanding on an
FD at a time in a user space threading implementation.

Look at it as if it were an operation queueing interface, and
there was a single queue for servicing both reads and writes
(VMS and many UNIX multidrop board drivers have exactly thjis
restriction on their non-threaded I/O!).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704222354.QAA27858>