X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=blobdiff_plain;f=model.h;h=4a1fcf49e2b64e732d52865bc0dc921031a61bf9;hp=8d10d51e7e2138904ae415cf8fa11c06c959765e;hb=0411b146dabd1aa32fc557067f0b5f74df8fc42b;hpb=15190694fd79202132be5f6e056fa5c00893664e diff --git a/model.h b/model.h index 8d10d51..4a1fcf4 100644 --- a/model.h +++ b/model.h @@ -34,6 +34,8 @@ typedef std::vector< const ModelAction *, MyAlloc > rel_hea struct model_params { int maxreads; int maxfuturedelay; + unsigned int fairwindow; + unsigned int enabledcount; }; struct PendingFutureValue { @@ -51,9 +53,6 @@ struct model_snapshot_members { modelclock_t used_sequence_numbers; Thread *nextThread; ModelAction *next_backtrack; - - /** @see ModelChecker::lazy_sync_size */ - unsigned int lazy_sync_size; }; /** @brief The central structure for model-checking */ @@ -92,6 +91,7 @@ public: void finish_execution(); bool isfeasibleprefix(); void set_assert() {asserted=true;} + const model_params params; MEMALLOC private: @@ -104,7 +104,6 @@ private: int num_executions; int num_feasible_executions; bool promises_expired(); - const model_params params; /** * Stores the ModelAction for the current thread action. Call this @@ -117,12 +116,13 @@ private: ModelAction * initialize_curr_action(ModelAction *curr); bool process_read(ModelAction *curr, bool second_part_of_rmw); bool process_write(ModelAction *curr); - void process_mutex(ModelAction *curr); + bool process_mutex(ModelAction *curr); + bool process_thread_action(ModelAction *curr); bool check_action_enabled(ModelAction *curr); bool take_step(); - void check_recency(ModelAction *curr); + void check_recency(ModelAction *curr, const ModelAction *rf); ModelAction * get_last_conflict(ModelAction *act); void set_backtracking(ModelAction *act); Thread * get_next_thread(ModelAction *curr); @@ -133,9 +133,9 @@ private: void check_curr_backtracking(ModelAction * curr); void add_action_to_lists(ModelAction *act); - ModelAction * get_last_action(thread_id_t tid); - ModelAction * get_last_seq_cst(ModelAction *curr); - ModelAction * get_last_unlock(ModelAction *curr); + ModelAction * get_last_action(thread_id_t tid) const; + ModelAction * get_last_seq_cst(ModelAction *curr) const; + ModelAction * get_last_unlock(ModelAction *curr) const; void build_reads_from_past(ModelAction *curr); ModelAction * process_rmw(ModelAction *curr); void post_r_modification_order(ModelAction *curr, const ModelAction *rf); @@ -164,21 +164,12 @@ private: std::vector *futurevalues; /** - * Collection of lists of objects that might synchronize with one or - * more release sequence. Release sequences might be determined lazily - * as promises are fulfilled and modification orders are established. - * This structure maps its lists by object location. Each ModelAction - * in the lists should be an acquire operation. - */ - HashTable *lazy_sync_with_release; - - /** - * Represents the total size of the - * ModelChecker::lazy_sync_with_release lists. This count should be - * snapshotted, so it is actually a pointer to a location within - * ModelChecker::priv + * List of acquire actions that might synchronize with one or more + * release sequence. Release sequences might be determined lazily as + * promises are fulfilled and modification orders are established. Each + * ModelAction in this list must be an acquire operation. */ - unsigned int *lazy_sync_size; + std::vector *pending_acq_rel_seq; std::vector *thrd_last_action; NodeStack *node_stack;