model: add immediate future value for RMW reordering
authorBrian Norris <banorris@uci.edu>
Thu, 10 Jan 2013 01:39:24 +0000 (17:39 -0800)
committerBrian Norris <banorris@uci.edu>
Thu, 24 Jan 2013 20:34:30 +0000 (12:34 -0800)
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

index 6453d537a93fdb41b91fa995551611e61f69c2fa..4ccdbce2f6700678ce62a684da817c61b4fa8db3 100644 (file)
--- 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);
                                }
                        }
                }