RE: Context switch Tick

From: Richard B. Johnson
Date: Wed Jun 02 2004 - 15:53:57 EST


On Wed, 2 Jun 2004, Garboua Nahil Y Contr WRALC/MASFE wrote:

> Okay, vmstat show me the cs according to current load, what is the Maximum
> tick rate?
> A process requests a 1 microseconds sleep, or even 500 nanoseconds, how long
> does it actually sleep, that is why I need to know max tick rate for context
> switch for a given CPU.

Can't you just measure it?

Script started on Wed Jun 2 16:48:51 2004
# ./tester
Testing CPU Speed (once at start of program)
CPU speed = 2803766848 Hz
Cycles to make the two function calls = 88
It took 55625156 cpu cycles or 19839.437091 microseconds.
# exit
Script done on Wed Jun 2 16:48:57 2004

That was for a usleep(1). Source attached.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.

Attachment: context.tar.gz
Description: Binary data