model: proactively build/prune is_enabled() set
authorBrian Norris <banorris@uci.edu>
Thu, 4 Apr 2013 08:00:17 +0000 (01:00 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 5 Apr 2013 17:29:04 +0000 (10:29 -0700)
commit1ad7373e04c1b94a927f4b8735bffe2c62af55f3
tree12a47b1a7bdc0ebb856426d4b1e15840f7e05163
parent2b493dff916099b11e559243b117ffd5eabe8f3b
model: proactively build/prune is_enabled() set

We should proactively check whether threads are enabled, as this allows
the model-checker to more accurately reason about backtracking, fairness
(particularly, assigning thread priorities), and sleep sets.

This commit causes changes in observed executions for many test
programs. Often, this occurs for programs where the main thread
performs a JOIN on a child thread. Previously, we would only discover
that this thread should be disabled once the scheduler attempts to
execute the JOIN ModelAction. For the period of the trace in which this
disabling isn't discovered, we may try to set backtracking points for
the main thread. These executions just turn into infeasible or
sleep-set-redundant executions anyway.

This can also affect the assertion of thread priority when assigning
backtracking points. If a thread is supposedly "enabled" (but in fact is
not), then we may prevent other threads from running because this thread has
priority. But that thread cannot run, so instead we were doing some
funky things with the remaining ("low-priority") threads.

This fix remedies these sorts of issues by precisely computing the set
of threads which are disabled, waiting on other threads/locks.
model.cc