mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Lemon <jlemon@flugsvamp.com>
To: Gideon Glass <gid@cisco.com>
Cc: Jonathan Lemon <jlemon@flugsvamp.com>,
	Simon Kirby <sim@stormix.com>,
	Dan Kegel <dank@alumni.caltech.edu>,
	chat@freebsd.org, linux-kernel@vger.kernel.org
Subject: Re: kqueue microbenchmark results
Date: Thu, 26 Oct 2000 11:50:57 -0500	[thread overview]
Message-ID: <20001026115057.A22681@prism.flugsvamp.com> (raw)
In-Reply-To: <20001024225637.A54554@prism.flugsvamp.com> <39F6655A.353FD236@alumni.caltech.edu> <20001025010246.B57913@prism.flugsvamp.com> <20001025112709.A1500@stormix.com> <20001025122307.B78130@prism.flugsvamp.com> <20001025114028.F12064@stormix.com> <20001025165626.B87091@prism.flugsvamp.com> <39F7F66C.55B158@cisco.com>
In-Reply-To: <39F7F66C.55B158@cisco.com>

On Thu, Oct 26, 2000 at 02:16:28AM -0700, Gideon Glass wrote:
> Jonathan Lemon wrote:
> > 
> > Also, consider the following scenario for the proposed get_event():
> > 
> >    1. packet arrives, queues an event.
> >    2. user retrieves event.
> >    3. second packet arrives, queues event again.
> >    4. user reads() all data.
> > 
> > Now, next time around the loop, we get a notification for an event
> > when there is no data to read.  The application now must be prepared
> > to handle this case (meaning no blocking read() calls can be used).
> > 
> > Also, what happens if the user closes the socket after step 4 above?
> 
> Depends on the implementation.  If the item in the queue is the
> struct file (or whatever an fd indexes to), then the implementation
> can only queue the fd once.  This also avoids the problem with
> closing sockets - close() would naturally do a list_del() or whatever
> on the struct file.
> 
> At least I think it could be implemented this way...

kqueue currently does this; a close() on an fd will remove any pending
events from the queues that they are on which correspond to that fd.
I was trying to point out that it isn't as simple as it would seem at
first glance, as you have to consider an issues like this.  Also, if the 
implementation allows multiple event types per fd, (leading to multiple
queued events per fd) there no longer is a 1:1 mapping to something like
'struct file', and performing a list walk doesn't scale very well.
--
Jonathan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

       reply	other threads:[~2000-10-26 16:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20001024225637.A54554@prism.flugsvamp.com>
     [not found] ` <39F6655A.353FD236@alumni.caltech.edu>
     [not found]   ` <20001025010246.B57913@prism.flugsvamp.com>
     [not found]     ` <20001025112709.A1500@stormix.com>
     [not found]       ` <20001025122307.B78130@prism.flugsvamp.com>
     [not found]         ` <20001025114028.F12064@stormix.com>
     [not found]           ` <20001025165626.B87091@prism.flugsvamp.com>
     [not found]             ` <39F7F66C.55B158@cisco.com>
2000-10-26 16:50               ` Jonathan Lemon [this message]
2000-10-27  0:50                 ` Alan Cox
2000-10-27  1:02                   ` Alfred Perlstein
2000-10-27  1:10                   ` Jonathan Lemon
2000-10-27  1:32                     ` Alan Cox
2000-10-27  1:46                       ` Alfred Perlstein
2000-10-27 16:21                       ` Dan Kegel
2000-10-27 16:42                         ` Alfred Perlstein
2000-10-27 23:08                         ` Terry Lambert
2000-10-28  0:24                           ` Dan Kegel
     [not found] <200010260610.XAA11949@usr08.primenet.com>
2000-10-26 18:08 ` Terry Lambert
     [not found] <20001025172702.B89038@prism.flugsvamp.com>
     [not found] ` <NCBBLIEPOCNJOAEKBEAKCEOPLHAA.davids@webmaster.com>
     [not found]   ` <20001025161837.D28123@fw.wintelcom.net>
2000-10-27 15:20     ` Jamie Lokier
2000-10-27 16:03       ` Alfred Perlstein

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=20001026115057.A22681@prism.flugsvamp.com \
    --to=jlemon@flugsvamp.com \
    --cc=chat@freebsd.org \
    --cc=dank@alumni.caltech.edu \
    --cc=gid@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sim@stormix.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®