multithreading - What's the cost/overhead of thread context switch? -


what's cost/overhead of thread context switch? far know, there direct costs:

  1. saving , restoring context(generally,it includes general purpose registers , program counter)
  2. costs of thread scheduling(deciding thread next run)

and there maybe indirect costs, such as: if thread switched out arranged run in cpu later, might re-load variables main memory(or other cpu via coherence protocol), cache read miss might occur.

is there other indirect costs?


Comments

Popular posts from this blog

c# - Can I intercept a SOAP response in .NET before a content type binding mismatch ProtocolException? -

python - WindowsError: [Error 740] The requested operation requires elevation even after disabling UAC -

python - Terminate a gnome-terminal opened with subprocess -