PC Review


Reply
Thread Tools Rate Thread

API compatible to poll() and epoll() of Linux

 
 
Rajat
Guest
Posts: n/a
 
      4th Feb 2005
Hi All,

I am looking for some APIs in window that have the smilar
functionalities provided by poll() or epoll() in Linux, for socket
programming.

Anyone have any idea??

Rajat.
 
Reply With Quote
 
 
 
 
kspecial@linuxmail.org
Guest
Posts: n/a
 
      4th Feb 2005
I know in perl you can use select() on your sockets to check when they
are ready for reading/writing. After searching msdn it seams the
winsock has a select() function:

http://msdn.microsoft.com/library/de...k/select_2.asp

Hope that helps,
--K-sPecial

 
Reply With Quote
 
Phil Frisbie, Jr.
Guest
Posts: n/a
 
      4th Feb 2005
Rajat wrote:

> Hi All,
>
> I am looking for some APIs in window that have the smilar
> functionalities provided by poll() or epoll() in Linux, for socket
> programming.
>
> Anyone have any idea??


On Windows you need to use 'overlapped I/O' or 'I/O completion ports' to get the
same scalability.

> Rajat.


--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com

 
Reply With Quote
 
Rajat
Guest
Posts: n/a
 
      5th Feb 2005
(E-Mail Removed) wrote in message news:<(E-Mail Removed)>...
> I know in perl you can use select() on your sockets to check when they
> are ready for reading/writing. After searching msdn it seams the
> winsock has a select() function:
>
> http://msdn.microsoft.com/library/de...k/select_2.asp
>
> Hope that helps,
> --K-sPecial


Ya I too know about select(), but I wanted the same functionalities as
provided by poll() or epoll().
 
Reply With Quote
 
K-sPecial
Guest
Posts: n/a
 
      7th Feb 2005
Don't poll and select do essentialy the same thing? Maybe I didn't
quite understand your question...

--K-sPecial

 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      7th Feb 2005
In article <(E-Mail Removed)>,
K-sPecial <(E-Mail Removed)> wrote:
on't poll and select do essentialy the same thing?

poll() can be used to get finer-grained information about the state
of a particular file descriptor; select() can be used to get cruder
information about a set of file descriptors.

See for example,
http://linux.com.hk/PenguinWeb/manpa...poll&section=2
--
How does Usenet function without a fixed point?
 
Reply With Quote
 
Barry Margolin
Guest
Posts: n/a
 
      8th Feb 2005
In article <cu71j8$i6$(E-Mail Removed)>,
(E-Mail Removed) (Walter Roberson) wrote:

> In article <(E-Mail Removed)>,
> K-sPecial <(E-Mail Removed)> wrote:
> on't poll and select do essentialy the same thing?
>
> poll() can be used to get finer-grained information about the state
> of a particular file descriptor; select() can be used to get cruder
> information about a set of file descriptors.


Poll() is also more efficient if there are lots of descriptors involved.
When select() returns, you have to search through all the descriptors
looking for the ones that became readable/writable, while poll() simply
returns the list of readable/writable descriptors.

--
Barry Margolin, (E-Mail Removed)
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
 
Reply With Quote
 
Vernon Schryver
Guest
Posts: n/a
 
      8th Feb 2005
In article <barmar-(E-Mail Removed)>,
Barry Margolin <(E-Mail Removed)> wrote:

>> poll() can be used to get finer-grained information about the state
>> of a particular file descriptor; select() can be used to get cruder
>> information about a set of file descriptors.

>
>Poll() is also more efficient if there are lots of descriptors involved.
>When select() returns, you have to search through all the descriptors
>looking for the ones that became readable/writable, while poll() simply
>returns the list of readable/writable descriptors.


More than that, a classic BSD kernel implementation of select() involved
sowakeup() to awakening all processes in the system stuck select() so
that each process can search its bit masks for a descriptor that
justifies returning to user mode. That works ok on a tiny system like
a VAX 780, but it's kind of slow on systems with lots of network jobs.
It's really painful on multi-processors with more than a trivial number
of CPUs because of the inter-CPU chatter required for locking file
descriptors and so forth.


Vernon Schryver (E-Mail Removed)
 
Reply With Quote
 
Michael Wojcik
Guest
Posts: n/a
 
      8th Feb 2005

[comp.os.ms-windows.networking.* removed from followup list, since this
is now about POSIX and Unix APIs.]

In article <cu9a0c$2kt4$(E-Mail Removed)>, (E-Mail Removed) (Vernon Schryver) writes:
> In article <barmar-(E-Mail Removed)>,
> Barry Margolin <(E-Mail Removed)> wrote:
>
> >> poll() can be used to get finer-grained information about the state
> >> of a particular file descriptor; select() can be used to get cruder
> >> information about a set of file descriptors.

> >
> >Poll() is also more efficient if there are lots of descriptors involved.
> >When select() returns, you have to search through all the descriptors
> >looking for the ones that became readable/writable, while poll() simply
> >returns the list of readable/writable descriptors.

>
> More than that, a classic BSD kernel implementation of select() involved
> sowakeup() to awakening all processes in the system stuck select() so
> that each process can search its bit masks for a descriptor that
> justifies returning to user mode.


Agreed. poll also doesn't suffer from select's FD_SETSIZE limit.
FD_SETSIZE can be changed at compile time, but that's inflexible and
wastes space if the app frequently only has a few descriptors in the
set. Or an app can maintain its own dynamically-sized FD_SETs, but
then the FD_* macros won't work. And overflowing FD_SETs was
recently documented as a security hole in a number of applications.

--
Michael Wojcik (E-Mail Removed)

It does basically make you look fat and naked - but you see all this stuff.
-- Susan Hallowell, TSA Security Lab Director, on "backscatter" scanners
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
{POLL} Windows Vista vs. Linux ? Worth the upgrade ? Worth the switchover? RonB Microsoft Windows 2000 59 17th Feb 2007 02:20 PM
{POLL} Windows Vista vs. Linux ? Worth the upgrade ? Worth the switchover? RonB Windows XP General 63 17th Feb 2007 02:20 PM
[poll] Linux hardware limcore@gazeta.pl Computer Hardware 0 8th Jan 2007 03:31 AM
POLL: LUA-compatible Vista enthusiasts? :-) Alexander Suhovey Windows Vista General Discussion 8 14th Nov 2006 06:55 PM
Linux-compatible webcam? Cyde Weys Computer Hardware 2 14th Aug 2004 01:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:10 PM.