morfizm (morfizm) wrote,

Context Switches

Somebody told me that there are "light" and "heavy" context switches. The "light" ones are between threads in the same process, and the "heavy" ones are between processes. He claims that "heavy" ones are significantly more expensive than "light" ones.

From what I remember, the biggest cost is kernel transition and swapping registers, that you'll have to do in any case, and changing process context isn't big deal (or isn't any deal at all?). Kernel treats all threads more or less equally.

I'd like to hear from experts: so is it a BS or is there really different cost if context switch happens between threads of the same process vs between processes?

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.