Bug 126 - USE_POLL not defined
Summary: USE_POLL not defined
Status: CLOSED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xlib (show other bugs)
Version: unspecified
Hardware: x86 (IA32) FreeBSD
: high minor
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-28 21:27 UTC by Eric Anholt
Modified: 2011-10-15 17:23 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Eric Anholt 2003-10-28 21:27:15 UTC
The XFree86 xlibs code defined USE_POLL if poll was available apparently, while
the libX11 from freedesktop.org doesn't appear to.
Comment 1 Jim Gettys 2003-10-29 10:23:12 UTC
I suspect we should use USE_POLL, but am not sure.

On Linux, however, I don't think XlibInt.c is compiled using USE_POLL;
it certainly isn't getting compiled with this set in XFree86 (I just
checked my build).

Keith, what is the right answer here?  Should we be using USE_POLL
on Linux?  
Comment 2 Keith Packard 2003-10-29 13:35:03 UTC
Is there any reason to prefer poll over select under Linux?  Is it faster?  It
seems like a lot of extra data manipulation to me.

If you want to use poll where available, it's very easy to add an autoconf test
for availability.
Comment 3 Jim Gettys 2003-10-29 13:53:55 UTC
I dunno which is preferable on Linux.  I seem to remember select has some
scaling issues.

I suppose we should ask a kernel expert...

So I called up Ted T'so....

Ted says that Poll is more efficient than select; on Linux
select is implemented in terms of poll.

Epoll is even more efficient for large numbers (thousands) of descriptors,
but we have 10-100 (in the server); in Xlib the number of descriptors is
tiny.

This is probably left over from the original Linux port; Linux probably
had select before it had poll...

So a patch to use poll would be gratefully accepted; I'm happy to play victim
on testing...
Comment 4 Eric Anholt 2003-10-29 23:45:23 UTC
I'll do up a patch for this soon.
Comment 5 Eric Anholt 2003-10-31 16:35:24 UTC
Patch committed by myself, 2003-10-31.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.