From ed8d4600431acccf43e7ac67ab523fd7486861d0 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 9 Jan 2013 17:39:24 -0800 Subject: [PATCH] model: add immediate future value for RMW reordering When RMW atomicity would otherwise rule an execution infeasible, we may need to pass a future value back 'immediately,' to allow the model-checker to effectively reorder the RMW's. For such cases, we don't wait for all current promises to be resolved. --- model.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/model.cc b/model.cc index 6453d53..4ccdbce 100644 --- a/model.cc +++ b/model.cc @@ -721,7 +721,6 @@ bool ModelChecker::process_read(ModelAction *curr, bool second_part_of_rmw) r_status = r_modification_order(curr, reads_from); } - if (!second_part_of_rmw && is_infeasible() && (curr->get_node()->increment_read_from() || curr->get_node()->increment_future_value())) { mo_graph->rollbackChanges(); priv->too_many_reads = false; @@ -1811,10 +1810,10 @@ bool ModelChecker::w_modification_order(ModelAction *curr) */ if (thin_air_constraint_may_allow(curr, act)) { - if (!is_infeasible() || - (curr->is_rmw() && act->is_rmw() && curr->get_reads_from() == act->get_reads_from() && !is_infeasible_ignoreRMW())) { + if (!is_infeasible()) futurevalues->push_back(PendingFutureValue(curr, act)); - } + else if (curr->is_rmw() && act->is_rmw() && curr->get_reads_from() && curr->get_reads_from() == act->get_reads_from()) + add_future_value(curr, act); } } } -- 2.34.1