public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alfred Perlstein <bright@wintelcom.net>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: David Schwartz <davids@webmaster.com>,
	Jonathan Lemon <jlemon@flugsvamp.com>,
	chat@FreeBSD.ORG, linux-kernel@vger.kernel.org
Subject: Re: kqueue microbenchmark results
Date: Fri, 27 Oct 2000 09:03:53 -0700	[thread overview]
Message-ID: <20001027090352.Y28123@fw.wintelcom.net> (raw)
In-Reply-To: <20001025172702.B89038@prism.flugsvamp.com> <NCBBLIEPOCNJOAEKBEAKCEOPLHAA.davids@webmaster.com> <20001025161837.D28123@fw.wintelcom.net> <20001027172006.A28504@pcep-jamie.cern.ch>
In-Reply-To: <20001027172006.A28504@pcep-jamie.cern.ch>; from lk@tantalophile.demon.co.uk on Fri, Oct 27, 2000 at 05:20:06PM +0200

* Jamie Lokier <lk@tantalophile.demon.co.uk> [001027 08:21] wrote:
> Alfred Perlstein wrote:
> > > If a programmer does not ever wish to block under any circumstances, it's
> > > his obligation to communicate this desire to the implementation. Otherwise,
> > > the implementation can block if it doesn't have data or an error available
> > > at the instant 'read' is called, regardless of what it may have known or
> > > done in the past.
> > 
> > Yes, and as you mentioned, it was _bugs_ in the operating system
> > that did this.
> 
> Not for writes.  POLLOUT may be returned when the kernel thinks you have
> enough memory to do a write, but someone else may allocate memory before
> you call write().  Or does POLLOUT not work this way?

POLLOUT checks the socketbuffer (if we're talking about sockets),
and yes you may still block on mbuf allocation (if we're talking
about FreeBSD) if the socket isn't set non-blocking.  Actually
POLLOUT may be set even if there isn't enough memory for a write
in the network buffer pool.

> For read, you still want to declare the sockets non-blocking so your
> code is robust on _other_ operating systems.  It's pretty straightforward.

Yes, it's true, not using non-blocking sockets is like ignoring
friction in a physics problem, but assuming you have complete
control over the machine it shouldn't trip you up that often.  And
we're talking about readability, not writeability which as you
mentioned may block because of contention for the network buffer
pool.


-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."
-
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-27 16:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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     ` kqueue microbenchmark results Jamie Lokier
2000-10-27 16:03       ` Alfred Perlstein [this message]
     [not found] <200010260610.XAA11949@usr08.primenet.com>
2000-10-26 18:08 ` Terry Lambert
     [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
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

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=20001027090352.Y28123@fw.wintelcom.net \
    --to=bright@wintelcom.net \
    --cc=chat@FreeBSD.ORG \
    --cc=davids@webmaster.com \
    --cc=jlemon@flugsvamp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lk@tantalophile.demon.co.uk \
    /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