mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-12-20 03:51:39 +03:00
Try alternative decisions if runnable prior is excluded by the bound
This commit is contained in:
parent
30ab912210
commit
424bdd2a6b
@ -460,7 +460,7 @@ dporSched memtype boundf = Scheduler $ \prior threads s ->
|
|||||||
-- otherwise add all runnable threads.
|
-- otherwise add all runnable threads.
|
||||||
initialise = tryDaemons . yieldsToEnd $ case prior of
|
initialise = tryDaemons . yieldsToEnd $ case prior of
|
||||||
Just (tid, act)
|
Just (tid, act)
|
||||||
| not (didYield act) && tid `elem` tids -> [tid]
|
| not (didYield act) && tid `elem` tids && isInBound tid -> [tid]
|
||||||
_ -> tids
|
_ -> tids
|
||||||
|
|
||||||
-- If one of the chosen actions will kill the computation, and
|
-- If one of the chosen actions will kill the computation, and
|
||||||
@ -491,8 +491,8 @@ dporSched memtype boundf = Scheduler $ \prior threads s ->
|
|||||||
doesKill t = killsDaemons t (action t)
|
doesKill t = killsDaemons t (action t)
|
||||||
|
|
||||||
-- Restrict the possible decisions to those in the bound.
|
-- Restrict the possible decisions to those in the bound.
|
||||||
restrictToBound f =
|
restrictToBound f = filter (isInBound . f)
|
||||||
filter (\x -> let t = f x in isJust $ boundf (schedBState s) prior (decision t, action t))
|
isInBound t = isJust $ boundf (schedBState s) prior (decision t, action t)
|
||||||
|
|
||||||
-- Move the threads which will immediately yield to the end of the list
|
-- Move the threads which will immediately yield to the end of the list
|
||||||
yieldsToEnd ts = case partition (willYield . action) ts of
|
yieldsToEnd ts = case partition (willYield . action) ts of
|
||||||
|
Loading…
Reference in New Issue
Block a user