i referring filter algorithm notes: http://cs.nyu.edu/wies/teaching/ppc-14/material/lecture02.pdf
it says, provides weak fairness , thread can taken overtaken arbitary number of times. (slide 98)
i not able understand part, last 1 write victim value has wait , waiting thread moves next level, how can 1 thread overtaken here?.
let's consider 4 threads (t0, t1, t2 , t3) using filter lock mutual exclusion.
we assume t0 gets stuck in level 0, t1 in level 1 , on. consequently t3 enters critical section , unlocks lock afterwards. note: t0 t2 stuck in while((∃k != i) level[k] >= l) && victim[l] == i) {};
several lines of code (see filter lock algorithm). on refer piece of code (c1). t2 goes on entering critical section , unlocking , t1. means t0 leave level 0's (c1)... doesn't mean can not overtaken! t3, t2 , t1 want acquire lock again. consequently 1 of 3 threads filtered out , stuck in level 0s (c1), because 1 thread "victim", lets t1. while t0 fulfills requirements leave (c1) still in for-loop of (c1) might "run slower" due various architectural reasons. allows t2 , t3 overtake t0.
Comments
Post a Comment