简体   繁体   中英

What is the context switching time?

I have a doubt in context switching. In multi threading, when the context switching occurs, what will be the time between two context switches? Is it fixed time interval?

It is really OS and situation dependent. You'll have to read about scheduling in general and about the specific threading technology you use: there is a nice list here .

When considering threads, the real wall-time intervals might change if other processes need CPU time, by that taking time from the process running the threads.

That being said, there are some nice C code samples to measure that time .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM