public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jyotiraditya@softhome.net
To: linux-kernel@vger.kernel.org
Subject: Select/Poll
Date: Tue, 01 Jun 2004 23:33:49 -0600	[thread overview]
Message-ID: <courier.40BD66BD.00006D7D@softhome.net> (raw)

Hello All, 

In one of the threads named: "Linux's implementation of poll() not 
scalable?'
Linus has stated the following:
**************
Neither poll() nor select() have this problem: they don't get more
expensive as you have more and more events - their expense is the number
of file descriptors, not the number of events per se. In fact, both poll()
and select() tend to perform _better_ when you have pending events, as
they are both amenable to optimizations when there is no need for waiting,
and scanning the arrays can use early-out semantics.
************** 

Please help me understand the above.. I'm using select in a server to read
on multiple FDs and the clients are dumping messages (of fixed size) in a
loop on these FDs and the server maintainig those FDs is not able to get all
the messages.. Some of the last messages sent by each client are lost.
If the number of clients and hence the number of FDs (in the server) is
increased the loss of data is proportional.
eg: 5 clients send messages (100 each) to 1 server and server receives
   96 messages from each client.
   10 clients send messages (100 by each) to 1 server and server again
   receives 96 from each client. 

If a small sleep in introduced between sending messages the loss of data
decreases.
Also please explain the algorithm select uses to read messages on FDs and
how does it perform better when number of FDs increases. 

Thanks and Regards,
Jyotiraditya 

             reply	other threads:[~2004-06-02  5:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02  5:33 jyotiraditya [this message]
2004-06-02  5:54 ` Select/Poll David Schwartz
2004-06-02  6:12   ` Select/Poll Ben Greear
2004-06-02  6:38     ` Select/Poll bert hubert
2004-06-02  6:09 ` Select/Poll Ben Greear
2004-06-02  7:05 ` Select/Poll Vadim Lobanov
2004-06-02 14:11   ` Select/Poll Davide Libenzi
2004-06-02 15:28 ` Select/Poll khandelw
2004-06-03 15:10   ` Select/Poll Mike Jagdis
2004-06-03 15:53     ` Select/Poll khandelw

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=courier.40BD66BD.00006D7D@softhome.net \
    --to=jyotiraditya@softhome.net \
    --cc=linux-kernel@vger.kernel.org \
    /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