public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* select() efficiency
@ 2005-07-22 21:18 Davy Durham
  2005-07-22 21:24 ` bert hubert
  0 siblings, 1 reply; 20+ messages in thread
From: Davy Durham @ 2005-07-22 21:18 UTC (permalink / raw)
  To: linux-kernel

Please forgive and redirect me if this is not the right place to ask 
this question:

I'm looking to write a sort of messaging system that would take input 
from any number of entities that "register" with it.. it would then 
route the messages to outputs and so forth..

I'm guessing that the messaging system would be a single process on the 
machine..

So, I'm considering making the means of input to the system be a unix 
socket.  An entity would connect to the socket as it's means of 
inputting messages into the system. 

However, lets suppose that 1000+ entities connect to that socket.. this 
would require the message system's loop to be adding 1000+ file 
descriptures to an fd_set and call select() every time it loops around 
to check for any messages.

So, my question is: how efficient would things be, doing selects() very 
often on 1000+ file descriptors?  I'm not aware of max size for an 
fd_set.. (I do know that NT is limited to 64 handles.. but that's really 
beside the point unless I look at porting someday)

Should I go another route?

The system is meant to rapidly route messages ASAP.. so it would be a 
bad idea to say write them to a file and poll the file or something like 
that...

Another thought was to use a system-wide mutex and write to a named 
pipe, but the socket method seems more appealing to me in design... and 
I didn't know if it was pretty much equivalent either way since either I 
will do the work of dealing with 1000+ things or the kernel will.

Thanks,
  Davy

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-08-24  7:50 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-22 21:18 select() efficiency Davy Durham
2005-07-22 21:24 ` bert hubert
2005-08-23  9:49   ` select() efficiency / epoll Davy Durham
2005-08-23 18:24     ` bert hubert
2005-08-23 11:01       ` Davy Durham
2005-08-23 11:25         ` Davy Durham
2005-08-23 19:12         ` Willy Tarreau
2005-08-23 11:24           ` Davy Durham
2005-08-23 19:45             ` Willy Tarreau
2005-08-23 11:55               ` Davy Durham
2005-08-23 20:20                 ` Willy Tarreau
2005-08-23 23:21                   ` Davide Libenzi
2005-08-23 17:08                     ` Davy Durham
2005-08-24  5:09                       ` Davide Libenzi
2005-08-23 22:35                         ` Davy Durham
2005-08-23 19:30     ` Jari Sundell
2005-08-23 11:53       ` Davy Durham
2005-08-23 20:42         ` Jari Sundell
2005-08-23 17:11           ` Davy Durham
2005-08-23 17:40           ` Davy Durham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox