
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] Bogus load data
On 12/09/06, Junichi Uekawa <dancer@example.com> wrote:
#include <sched.h>
sched_yield()
might give more interesting results; although it really depends on
what you're after.
Interesting. Since I basically want to ensure one or more context
switches, it would probably be a good idea to put the sched_yield()
call right before the sleep(). I don't want to lose the sleep()
call--I like the fact that it introduces some time for the kernel to
do other stuff, thus making my timings a little more random.
And wow! sched_yield is actually POSIX! I figured it was just a Linux
syscall, but this is great, because including it in my program will
not cost me portability to other Unices.
Cheers, Junichi!
-Josh
Home |
Main Index |
Thread Index