From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: light weight user level semaphores
Date: Thu, 19 Apr 2001 22:47:07 +0200 [thread overview]
Message-ID: <20010419224707.K682@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <3ADEA746.D3A44511@alsa-project.org> <Pine.LNX.4.31.0104190903560.3842-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.31.0104190903560.3842-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Thu, Apr 19, 2001 at 09:11:56AM -0700
On Thu, Apr 19, 2001 at 09:11:56AM -0700, Linus Torvalds wrote:
> No, this is NOT what the UNIX dogmas are all about.
>
> When UNIX says "everything is a file", it really means that "everything is
> a stream of bytes". Things like magic operations on file desciptors are
> _anathema_ to UNIX. ioctl() is the worst wart of UNIX. Having magic
> semantics of file descriptors is NOT Unix dogma at all, it is a horrible
> corruption of the original UNIX cleanlyness.
Right. And on semaphores, this stream is exactly 0 bytes long.
This is perfectly normal and can be handled by all applications
I'm aware of.
My idea violates nothing here.
> Please don't excuse "semaphore file descriptors" with the "everything is a
> file" mantra. It is not at ALL applicable.
>
> The "everything is a file" mantra is to make pipe etc meaningful -
> processes don't have to worry about whether the fd they have is from a
> file open, a pipe() system call, opening a special block device, or a
> socket()+connect() thing. They can just read and write. THAT is what UNIX
> is all about.
Right. And with my approach read() and write() with a buffer
pointer != NULL would either yield an return value of "0" or
-1 and set errno=EINVAL ("object not suitable for reading/writing").
Anyway they should return IMMIDIATELY in these cases.
We already have these special semantics with devices. Look at
/dev/sgX for an example how we pass even structured data via
normal read/write (instead of "stream of bytes").
> And this is obviously NOT true of a "magic file descriptors for
> semaphores". You can't pass it off as stdin to another process and expect
> anything useful from it unless the other process _knows_ it is a special
> semaphore thing and does mmap magic or something.
see above. NOTHING special about this idea. No magic handling
involved, unless the user of the fd knows what it is. For other
users it will be just a normal fd with normal operations, since
the special case is hidden well enough.
This is even WAY simpler as all that tty-crap and similar
devices, which read/write very dependend on their actual ioctl
configuration.
But since stupid POSIX forbids using fds for semaphores
(according to Ulrich Drepper), this nice, simple and
non-intrusive solution is out.
Instead we should go with several new syscalls, user space
dependencies, strange error handling and yet-to-discuss
semantics.
Everybody else byt you would have been kicked out by the core
people for suggesting this ;-)
Regards
Ingo Oeser
--
10.+11.03.2001 - 3. Chemnitzer LinuxTag <http://www.tu-chemnitz.de/linux/tag>
<<<<<<<<<<<< been there and had much fun >>>>>>>>>>>>
next prev parent reply other threads:[~2001-04-19 20:47 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010417114433.D1108@w-mikek2.sequent.com>
2001-04-17 19:48 ` Linus Torvalds
2001-04-18 18:13 ` Bernd Eckenfels
2001-04-18 19:35 ` Ulrich Drepper
2001-04-19 8:20 ` Alon Ziv
2001-04-19 8:52 ` Abramo Bagnara
2001-04-19 9:08 ` Alexander Viro
2001-04-19 10:44 ` Abramo Bagnara
2001-04-19 16:11 ` Linus Torvalds
2001-04-19 16:33 ` Alexander Viro
2001-04-19 16:43 ` Linus Torvalds
2001-04-19 17:33 ` Alexander Viro
2001-04-19 17:38 ` Linus Torvalds
2001-04-19 18:24 ` Alexander Viro
2001-04-19 19:26 ` Ulrich Drepper
2001-04-19 19:35 ` Alan Cox
2001-04-19 20:06 ` Ulrich Drepper
2001-04-19 20:11 ` Alan Cox
2001-04-19 20:26 ` Ulrich Drepper
2001-04-19 20:22 ` Ingo Oeser
2001-04-19 20:40 ` Ulrich Drepper
2001-04-19 20:51 ` Linus Torvalds
2001-04-19 21:38 ` Alan Cox
2001-04-19 20:49 ` Linus Torvalds
2001-04-19 21:18 ` Ulrich Drepper
2001-04-19 21:41 ` Linus Torvalds
2001-04-19 22:46 ` Ulrich Drepper
2001-04-20 1:35 ` Alexander Viro
2001-04-20 2:45 ` Ulrich Drepper
2001-04-19 16:43 ` Abramo Bagnara
2001-04-19 20:47 ` Ingo Oeser [this message]
2001-04-19 20:54 ` Linus Torvalds
2001-04-19 9:08 ` Ingo Oeser
2001-04-19 11:51 ` Alan Cox
2001-04-19 16:03 ` Linus Torvalds
2001-04-19 16:38 ` Alan Cox
2001-04-19 16:46 ` Linus Torvalds
2001-04-19 17:12 ` Alan Cox
2001-04-19 22:35 ` Rogier Wolff
2001-04-20 9:29 ` Olaf Titz
2001-04-20 14:19 ` Jesse Pollard
2001-04-20 18:36 ` Olaf Titz
2001-04-20 23:33 ` Linus Torvalds
2001-04-21 4:06 ` fd allocation [was: light weight user level semaphores] Edgar Toernig
2001-04-22 9:48 ` Olaf Titz
2001-04-22 11:41 ` light weight user level semaphores Alon Ziv
2001-04-22 12:44 ` Alan Cox
2001-04-22 15:19 ` Alon Ziv
2001-04-22 14:31 ` Alexander Viro
2001-04-22 16:08 ` Alon Ziv
2001-04-22 11:41 ` Alon Ziv
2001-04-22 14:18 ` David Woodhouse
2001-04-23 13:19 ` David Howells
2001-04-23 14:48 ` Alon Ziv
2001-04-23 15:40 ` David Howells
2001-04-21 10:13 ` Olaf Titz
2001-04-23 15:34 ` Jeff Garzik
2001-04-23 19:18 ` Ingo Oeser
2001-04-24 0:19 ` David Wagner
2001-04-24 0:41 ` Alexander Viro
2001-04-19 19:47 ` Ulrich Drepper
2001-04-19 18:48 ` Olaf Titz
2001-04-19 13:59 George Talbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010419224707.K682@nightmaster.csn.tu-chemnitz.de \
--to=ingo.oeser@informatik.tu-chemnitz.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®