operating system - Trouble understanding preemptive kernel -
how preemptive kernel lead race conditions? if process preempted i.e. isn't kicked out of critical section . understanding race condition when several processes try access , manipulate resources concurrently right. have trouble grasping concept
a preemptive kernel can start , stop threads @ point. means threads don't coordinate accesses through locks , critical sections end in race conditions.
the other form of multithreading cooperative multithreading, threads can stopped @ points explicitly offer yield processor. helps prevent race conditions because threads not interrupted @ random unexpected points in processing.
the downside of cooperative multithreading thread written not yield can hog processor, , why modern operating systems use preemptive multithreading rather cooperative multithreading.
Comments
Post a Comment