mongodb/mongo — pull request #227 by ebroder (2012-05-31 16:49:15+00:00)
Title: Remove the timeout in the main select call in mongod

The timeout is only being used to coarsely track elapsed time, but it
causes the process to wake up unnecessarily about 100 times a second,
only for it to discover it has nothing to do and go back to sleep.

Instead, allow the process to sleep until there's work available, and
then query the system clock to figure out how much time has passed,
using a guaranteed monotonically increasing clock on Linux (where it's
available) and gettimeofday everywhere else (where it's not).