fix scheduling stuff to get nice round robin scheduler behavior...
authorBrian Demsky <bdemsky@uci.edu>
Mon, 25 Feb 2013 04:59:46 +0000 (20:59 -0800)
committerBrian Demsky <bdemsky@uci.edu>
Mon, 25 Feb 2013 04:59:46 +0000 (20:59 -0800)
model.cc
schedule.cc
schedule.h

index ae3788945c7756881178b1657bb215cf5a71901a..7fdc824669588e216017846490751e14d69337eb 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -282,6 +282,8 @@ Thread * ModelChecker::get_next_thread(ModelAction *curr)
                                earliest_diverge = prevnode->get_action();
                        }
                }
+               /* Start the round robin scheduler from this thread id */
+               scheduler->set_scheduler_thread(tid);
                /* The correct sleep set is in the parent node. */
                execute_sleep_set();
 
index e87490313cf4836e1f11dab9528ef7ad00b6bf26..8d44eec6d7648b467aa2bc3bf0abfc1c3478ca38 100644 (file)
@@ -207,6 +207,10 @@ Thread * Scheduler::select_next_thread()
        return NULL;
 }
 
+void Scheduler::set_scheduler_thread(thread_id_t tid) {
+       curr_thread_index=id_to_int(tid);
+}
+
 /**
  * @brief Set the current "running" Thread
  * @param t Thread to run
@@ -215,7 +219,7 @@ void Scheduler::set_current_thread(Thread *t)
 {
        ASSERT(t && !t->is_model_thread());
 
-       curr_thread_index = id_to_int(t->get_id());
+       //      curr_thread_index = id_to_int(t->get_id());
 
        current = t;
        if (DBG_ENABLED())
index 121da08db05a3d0d735c4ca34926006b364c85cb..6ae2d2b53eeb354d522d9aac187c38cbdd4226b7 100644 (file)
@@ -39,6 +39,8 @@ public:
        bool is_enabled(const Thread *t) const;
        bool is_enabled(thread_id_t tid) const;
        bool is_sleep_set(const Thread *t) const;
+       void set_scheduler_thread(thread_id_t tid);
+
 
        SNAPSHOTALLOC
 private: