public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Kegel <dank@alumni.caltech.edu>
To: Terry Lambert <tlambert@primenet.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Jonathan Lemon <jlemon@flugsvamp.com>,
	Gideon Glass <gid@cisco.com>, Simon Kirby <sim@stormix.com>,
	chat@FreeBSD.ORG, linux-kernel@vger.kernel.org
Subject: Re: kqueue microbenchmark results
Date: Fri, 27 Oct 2000 17:24:56 -0700	[thread overview]
Message-ID: <39FA1CD8.6C6ABAEE@alumni.caltech.edu> (raw)
In-Reply-To: <200010272308.QAA29462@usr01.primenet.com>

Terry Lambert wrote:
> 
> > > Which is precisely why you need to know where in the chain of events this
> > > happened. Otherwise if I see
> > >         'read on fd 5'
> > >         'read on fd 5'
> > > How do I know which read is for which fd in the multithreaded case
> >
> > That can't happen, can it?  Let's say the following happens:
> >    close(5)
> >    accept() = 5
> >    call kevent() and rebind fd 5
> > The 'close(5)' would remove the old fd 5 events.  Therefore,
> > any fd 5 events you see returned from kevent are for the new fd 5.
> 
> Strictly speaking, it can happen in two cases:
> 
> 1)      single acceptor thread, multiple worker threads
> 2)      multiple anonymous "work to do" threads
> 
> In both these cases, the incoming requests from a client are
> given to any thread, rather than a particular thread.
> 
> In the first case, we can have (id:executer order:event):
> 
> 1:1:open 5
> 2:2:read 5
> 3:4:read 5
> 2:3:close 5
> 
> If thread 2 processes the close event before thread 3 processes
> the read event, then when thread 3 attempts procssing, it will
> fail.

You're not talking about kqueue() / kevent() here, are you?
With that interface, thread 2 would not see a close event;
instead, the other events for fd 5 would vanish from the queue.
If you were indeed talking about kqueue() / kevent(), please flesh
out the example a bit more, showing who calls kevent().

(A race that *can* happen is fd 5 could be closed by another
thread after a 'read 5' event is pulled from the event queue and
before it is processed, but that could happen with any
readiness notification API at all.)

- Dan
-
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-28  0:19 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               ` kqueue microbenchmark results Jonathan Lemon
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 [this message]
     [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=39FA1CD8.6C6ABAEE@alumni.caltech.edu \
    --to=dank@alumni.caltech.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chat@FreeBSD.ORG \
    --cc=gid@cisco.com \
    --cc=jlemon@flugsvamp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sim@stormix.com \
    --cc=tlambert@primenet.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