Sidebar on poll/select (was Clients can freeze other clients)

David Collier-Brown davecb at
Wed Sep 1 12:09:32 GMT 1999

Jeremy Allison wrote:
> In lib/system.c we have both - we can implement select()
> in terms of poll() if neccessary (check out the USE_POLL
> #define).

	Thanks: you might consider making it the default
	for Solaris 2.6 and later, as the implementation
	(but not the interface) changed to kernel sockets
	at that time.  Right around then select(3) became
	implemented in terms of poll(2).

	This was not true in the 2.0-2.5.1 timeframe, as
	the socket implementation was actually on top 
	of streams.  I don't know if poll(3) was better than
	select(3) in that time period...

	The technical reason for poll(2) is the 1024-descriptor
	limit in select: poll doesn't care how many FDs you
	use, and folks keep asking for lots of FDs. The
	same folks who asked for 64-bit address spaces,
	no doubt!

	The performance reason is to save a pair of
	list traversals converting the select bitmaps into 
	flags in the fd array used by poll and then back again.

	The cost is in non-standardness, and testing in the
	configure script.	

David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   |
Work: (905) 415-2849 Home: (416) 223-8968 Email: davecb at

More information about the samba-technical mailing list