On Wed, 1 Dec 1999, Shaul Karl wrote:
> I found the last paragraph of subsection 12.1.1 of the "Linux Application
> Development" (3rd edition) contradicting my knowledge. Am I right that it is
> not accurate, or do I missing something essential?
>
>
> Trying to quote the paragraph without copying the entire subsection, I get:
>
> Although nonblocking I/O allows us to switch easily between file descriptors,
> it has a high price. If it was up to the polling processes then they would
> constantly be running - never blocks. Which inflicts a heavy performance
> penalty on the system as the OS can never put these processes to sleep (try
> running 10 processes like the one that was discussed previously and see how it
> affects system performance).
>
> "the OS can never put these processes to sleep"?- Perhaps in the Windows
> world, but with Linux/Unix?
Well, if you're actually *polling*, then the process will not sleep - it
sleeps only during the time given to select() - but since you're polling,
so there's no sleep period. And if you're polling constantly, you'll
certainly load the system. Even more, if you're polling in a loop just
waiting for a file descriptor to be ready - it destroys all the advantages
of non-blocking I/O and really wastes CPU's time (so called "busy
waiting").
Regards,
Andre.
--
================================================================
# Andre E. Bar'yudin #
# Home page: http://www.cs.huji.ac.il/~baryudin #
# E-mail: [EMAIL PROTECTED] #
# Phone: (972)-53-812-026 #
================================================================
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]