Home › GATE CSE › computerscience › Operating Systems › Thread context switches are cheaper than process…
Thread context switches are cheaper than process context switches because
Athreads are written in a different programming language
Bthread switches need not flush TLB or change memory mappings
Cthreads use less RAM than processes
Dthread switches skip the PCB save-restore step
Answer & Solution
Correct answer: B. thread switches need not flush TLB or change memory mappings
Threads of the same process share the address space. Switching between them does not require flushing the TLB, changing page tables or reloading the memory map. A process switch does all of that, plus saves/restores the PCB. The savings make threads the go-to model for concurrency within an app.
Related questions
On a MULTI-CORE system, a SPIN LOCK is generallyDisabling INTERRUPTS as a way to implement mutual exclusion on a single-CPU system isA LIVELOCK differs from a DEADLOCK in thatSuppose thread A acquires lock L1, then thread B acquires lock L2. Now A tries to acquire Without atomic hardware support, building a correct mutual-exclusion lock for $N \geq 2$ tA CRITICAL SECTION isLinux's `pthread_mutex_lock()` is typically implemented as a HYBRID:What is the PRIMARY problem with using a SPIN LOCK on a SINGLE-CPU uniprocessor system (wi