Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long does a context switch take in Linux?

I'm curious how many cycles it takes to change contexts in Linux. I'm specifically using an E5405 Xeon (x64), but I'd love to see how it compares to other platforms as well.

like image 552
twk Avatar asked Sep 14 '25 09:09

twk


1 Answers

There`s a free app called LMBench written by Larry McVoy and friends. It provides a bunch of OS & HW benchmarks One of the tests is called lat_ctx and it measures contex switch latencies. Google for lmbench and check for yourself on your own HW. Its the only way to get a number meaningful to you.

Gilad

like image 139
gby Avatar answered Sep 17 '25 01:09

gby