What are the Disadvantages of poll, /dev/poll

What are the Disadvantages of poll, /dev/poll

Post by kb » Thu, 28 Jun 2001 19:20:56



It seems to me (the newbie) that /dev/poll (if available) and poll()
provide better multiplexing capability than select().  What are the
disadvantages of these functions?
 
 
 

What are the Disadvantages of poll, /dev/poll

Post by Zoran Cutur » Thu, 28 Jun 2001 20:24:32



Quote:> It seems to me (the newbie) that /dev/poll (if available) and
> poll() provide better multiplexing capability than select().
> What are the disadvantages of these functions?

That depends on how poll or select are implemented. As long as
we don't know about which implementation you're talking, we
can't guess what it does. Anyhow I really can't think of any
dissadvantage against select as it seems to be easier to use.

IIRC, the linux poll system call was implemented by calling
select prior to some 2.3 Kernel (or was it 2.1). So I don't
expect any big differences.

--

"LISP  is worth learning for  the profound enlightenment  experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days."   -- Eric S. Raymond

 
 
 

What are the Disadvantages of poll, /dev/poll

Post by kb » Fri, 29 Jun 2001 00:17:14


Quote:> That depends on how poll or select are implemented. As long as we don't
> know about which implementation you're talking, we can't guess what it
> does.

Solaris 8
Linux 2.213+  (Thanks for the info abt that btw)
Linux 2.4
 
 
 

What are the Disadvantages of poll, /dev/poll

Post by David Schwart » Fri, 29 Jun 2001 06:30:31



> Anyhow I really can't think of any
> dissadvantage against select as it seems to be easier to use.

        Then you're not thinking very hard!

        1) If you want information about a few high-numbered file descriptors,
select requires scanning through all the lower bits just to not find
them set.

        2) If you select on a file descriptor that's not valid, select will
give you an error but not tell you which file descriptor it involves,
forcing you to scan each one.

        3) There is really no good way to know what file descriptors you can
safely 'select' on and which you can't. You can't rely on
'getdtablesize' or 'sizeof(fd_set)*8' to provide this information
reliably.

        4) Poll information you of normal termination immediately, saving you
from the effort of getting into your 'read' routine, getting a buffer to
'read' into, calling 'read', and then freeing that buffer. (Of course,
the exact savings will vary based upon implementation details).

        There are others, these four are just the most obvious.

        DS

 
 
 

What are the Disadvantages of poll, /dev/poll

Post by Zoran Cutur » Sat, 30 Jun 2001 14:30:57




>> Anyhow I really can't think of any dissadvantage against
>> select as it seems to be easier to use.

>    Then you're not thinking very hard!

>    1) If you want information about a few high-numbered file
>    descriptors,
> select requires scanning through all the lower bits just to not
> find them set.

>    2) If you select on a file descriptor that's not valid, select
>    will
> give you an error but not tell you which file descriptor it
> involves, forcing you to scan each one.

>    3) There is really no good way to know what file descriptors
>    you can
> safely 'select' on and which you can't. You can't rely on
> 'getdtablesize' or 'sizeof(fd_set)*8' to provide this
> information reliably.

>    4) Poll information you of normal termination immediately,
>    saving you
> from the effort of getting into your 'read' routine, getting a
> buffer to 'read' into, calling 'read', and then freeing that
> buffer. (Of course, the exact savings will vary based upon
> implementation details).

David,

I said I can't think of any disadvantage of poll against select.
So we're talking the same direction.

--

"LISP  is worth learning for  the profound enlightenment  experience
you will have when you finally get it; that experience will make you
a better programmer for the rest of your days."   -- Eric S. Raymond

 
 
 

1. poll/select in udprelay - anyone have poll.c(h) code for linux?

Gee, two years go by and I'm in the same situation as this guy.

 Does anyone out there have this code? I have udprelay and need the
poll.c poll.h
code as descibed in this old post.

 Any help will be greatly appreciated.

 I am also surprised that udprelay and redir are not on sunsite. I have
redir (tcp) working
on my system. but I really want to get udprelay working too.

 Why not build this code into IPMASQ???

 TIA

[ patch omitted ]

Alternatively, you can write a version of poll() in terms of select(2)
(which is what I did, since I didn't feel like hacking up udprelay
source).
If you'd rather use that approach, send me mail, and I'll send you my
poll.[ch] files. We're currently using udprelay on a BSDI system, and
the
emulated poll() function works just fine.


Telebase Systems, Inc., 435 Devon Park Drive, Wayne, PA 19087

--
* --------------------------------------------------- *

*                  http://www.mygen.com
* P.O. Box 7167 , Tahoe City Ca. 96145
* --------------------------------------------------- *

2. Problem with Telnet

3. hylafax, poll sending, poll server

4. ne2000 probe hangs system on boot

5. Q: poll.h and poll()

6. Samba Share - NT Authentication

7. To POLL or Not To POLL the mouse

8. Linux and Jaz drives

9. My Freebsd driver hangs in poll function after some time (problem with poll)

10. poll.h file and poll function

11. poll.h file and poll function not found

12. Linux patches for dev/poll or dev/epoll

13. /dev/poll ioctl dvpoll.dp_nfds usage changed?