|
|||||||
This is a discussion on "poll() vs select()" in the Top Mud Sites MUD Coding forum : I was talking to one of my irc mates who happends to be one of the major coders for the dalnet irc server(s) and he was talking about them recently switching from select() to poll(). I don't understand much about it, bue he says its is alot faster. Unfortuatly, since i don't truely understand it, and have yet to really find any examples on how to use it (other than a simple one he showed me). I was wondering if its worth looking into more? or for a mud with 20 or so people on at once ... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
New Member
|
I was talking to one of my irc mates who happends to be one of the major coders for the dalnet irc server(s) and he was talking about them recently switching from select() to poll().
I don't understand much about it, bue he says its is alot faster. Unfortuatly, since i don't truely understand it, and have yet to really find any examples on how to use it (other than a simple one he showed me). I was wondering if its worth looking into more? or for a mud with 20 or so people on at once max (i'm being hopeful as its a brand new mud that hasn't even started yet) is it even worth it? does the speed different matter then? |
|
|
|
|
|
#2 |
|
Member
|
It boils down to a matter of preference... with select() you give three lists to select(), one for ready to read, one for ready to write, one for exceptions. With poll() you send one array, and you have to check each element for each possibility. Also.. with poll(), if you only want to use one system call per loop around, you are going to have to ensure that all your struct pollfds are in one spot in memory, so that could cause either more system calls with malloc/calloc/etc, or you simply rebuild this list each iteration. Either way I have trouble seeing this being noticeably faster than select(), unless said ircd was coded very poorly with select(), but I could be missing something.
The point would also be somewhat moot on an older machine (before 97 at least, older), since the kernel won't support a poll() call, the compiler will have to turn poll() into a select() anyway! |
|
|
|
![]() |
| Thread Tools | |
poll() vs select() - Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| game_loop(), select(), and dual core CPUs | Samson | MUD Coding | 3 | 02-17-2007 11:11 PM |
| Mythology Poll | Burr | Tavern of the Blue Hand | 10 | 10-30-2002 07:02 PM |
| $ Info, le Poll | TG_Nek | Bugs and Suggestions | 80 | 10-20-2002 06:35 PM |
| Poll | Feyona | Tavern of the Blue Hand | 18 | 09-14-2002 07:29 PM |
| Not a Poll | Feyona | Introduce Yourself | 2 | 06-20-2002 05:07 PM |
|
|