Using Select and blocked I/O
I am using recvfrom with UDP and recv with TCP. Using blocking, what is the difference between calling select() 100 times with a 1ms timeout vs calling select() one time with a 100ms timeout? What exactly does the operating system do during the select? How expensive is it to repeatedly call select? Will other processes be able to run while we are blocking?
Thanks for any and all help.
Using select instead of usleep
You're right; 20 ms does seem to be a long time and I would not have expected this. (By the way, we are using LynxOS). However, when I searched for help on this I found similar posts from other users finding 20 ms also. But because usleep is non-deterministic and waits a minimum of the time specified, we opted to use select instead.