For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > March 2008 > Re: socket programming using MSG_WAITALL for receiving multicast









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: socket programming using MSG_WAITALL for receiving multicast
David Schwartz

2008-03-20, 7:15 pm

On Mar 20, 4:23 pm, jiangxu...@gmail.com wrote:

> I am receiving high bit rate streamming data such as Video data. I
> think it will be more efficient with less context switch between
> kernel and user space.


Don't worry, the scheduler agrees with you. When efficiency matters,
there will be less context switching.

> So if the kernel can accumulate more packets
> before wake up the function, it should be more CPU efficient, right?


Right, and that's exactly what the kernel will do, all by itself.

If you test with no load, you will get lots of context switches. This
is fine -- you can't save CPU in a jar to use later. As soon as the
load goes up, the system will spend time doing other things and by the
time your process gets to run, more packets will be accumulated as if
by magic.

Don't try to "fix" the scheduler. It's not broken.

DS
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com