mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Nicholas Miell <nmiell@comcast.net>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [patch 6/9] signalfd/timerfd v1 - timerfd core ...
Date: Sat, 10 Mar 2007 16:35:11 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0703101630260.10330@woody.linux-foundation.org> (raw)
In-Reply-To: <1173572751.2958.107.camel@entropy>



On Sat, 10 Mar 2007, Nicholas Miell wrote:
> > 
> > I'd actually much rather do POSIX timers the other way around: associate a 
> > generic notification mechanism with the file descriptor, and then 
> > implement posix_timer_create() on top of timerfd. Now THAT sounds like a 
> > clean unix-like interface ("everything is a file") and would imply that 
> > you'd be able to do the same kind of notification for any file descriptor, 
> > not just timers.
> > 
> 
> But timers aren't files or even remotely file-like

What do you think "a file" is?

In UNIX, a file descriptor is pretty much anything. You could say that 
sockets aren't remotely file-like, and you'd be right. What's your point? 
If you can read on it, it's a file.

And the real point of the whole signalfd() is that there really *are* a 
lot of UNIX interfaces that basically only work with file descriptors. Not 
just read, but select/poll/epoll.

They currently have just one timeout, but the thing is, if UNIX had just 
had "timer file descriptors", they'd not need even that one. And even with 
the timeout, Davide's patch actually makes for a *better* timeout than the 
ones provided by select/poll/epoll, exactly because you can do things like 
repeating timers and absolute time etc.

Much more naturally than the timer interface we currently have for those 
system calls.

The same goes for signals. The whole "pselect()" thing shows that signals 
really *should* have been file descriptors, and suddenly you don't need 
"pselect()" at all.

So the "not remotely file-like" is not actually a real argument. One of 
the big *points* of UNIX was that it unified a lot under the general 
umbrella of a "file descriptor". Davide just unifies even more.

		Linus

  reply	other threads:[~2007-03-11  0:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 23:41 Davide Libenzi
2007-03-10  6:33 ` Nicholas Miell
2007-03-10  6:38   ` Davide Libenzi
2007-03-10  6:43     ` Nicholas Miell
2007-03-10  6:53       ` Davide Libenzi
2007-03-10  7:09         ` Nicholas Miell
2007-03-10  7:36           ` Davide Libenzi
2007-03-10 19:52             ` Nicholas Miell
2007-03-10 20:41               ` Davide Libenzi
2007-03-10 21:01                 ` Nicholas Miell
2007-03-10 21:44                   ` Linus Torvalds
2007-03-10 21:56                     ` Nicholas Miell
2007-03-10 22:42                       ` Linus Torvalds
2007-03-11  0:25                         ` Nicholas Miell
2007-03-11  0:35                           ` Linus Torvalds [this message]
2007-03-11  1:49                             ` Nicholas Miell
2007-03-11  1:57                               ` Davide Libenzi
2007-03-11  2:09                                 ` Nicholas Miell
2007-03-11  5:31                               ` Linus Torvalds
2007-03-11  6:18                                 ` Nicholas Miell
2007-03-11 16:29                                   ` Linus Torvalds
2007-03-11  3:42                         ` Davide Libenzi
2007-03-11  5:35                           ` Linus Torvalds
2007-03-11  5:44                             ` Davide Libenzi
2007-03-10 22:30                   ` Davide Libenzi

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=Pine.LNX.4.64.0703101630260.10330@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nmiell@comcast.net \
    /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®