Review Board 2.0.15


Replace curTick global variable with accessor functions.

Review Request #374 - Created Jan. 4, 2011 and submitted

Information
Steve Reinhardt
gem5
Reviewers
Default
ali, gblack, nate, stever
Replace curTick global variable with accessor functions.
This step makes it easy to replace the accessor functions
(which still access a global variable) with ones that access
per-thread curTick values.

   
Ship it!
Posted (Jan. 4, 2011, 6:59 a.m.)
Maybe it's too much for this diff, but I think you can get rid of the global variable and put _curTick in the event queue class.  Then you can put a curTick() accessor into the EventQueue and EventManager classes, and create a global curTick (though maybe with a different name like mainCurTick() so we can tell what is what) that accesses mainEventQueue.curTick().  Maybe not needed for this diff, but certainly something that would seem to be a good step.  Thanks for doing this.  I've been wanting to do exactly this for a while.
  1. I want to keep this a purely syntactic change, because I think the semantic changes are going to require some discussion.  For example, my current next-step patch replaces mainEventQueue with an array of queues (so there is no single main event queue any more), and uses TLS to implement per-thread curTick values rather than embedding them in the queues, so it doesn't follow the path you're proposing.  If you want to discuss this further please start a new email thread.
    
    The good news is that once this patch gets committed then all these options can be explored with fairly local changes.
Ship it!
Posted (Jan. 4, 2011, 8:46 a.m.)