Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   poll() vs select() (http://www.topmudsites.com/forums/showthread.php?t=268)

halkeye 02-02-2003 04:10 PM

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?

Koryon 02-05-2003 08:35 PM

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!


All times are GMT -4. The time now is 01:19 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022