On Thu, 24 Feb 2011 10:43:52 -0800, Steve Reinhardt wrote:
On Wed, Feb 23, 2011 at 5:03 PM, Gabe Black wrote: Forgive my ignorance here, but why is the limit event set up each time simulate is called? Couldn't it just be a member of the event queue class and always stuck at the end and left there? The limit can change from call to call, and it's not necessarily the last thing on the queue, so you do have to at least reschedule it between calls to simulate(). On Wed, Feb 23, 2011 at 5:25 PM, nathan binkert wrote: Though you can't make an exit_event AutoDelete because the event needs to be returned to python. So holding onto it and reusing it between simulate() calls is probably the correct thing to do. That's one approach. Another is to not pass the event itself back to python, but to create a new class like SimExitCause that's something like a python exception class, and pass a dynamically allocated instance of that into exitSimLoop() instead of a string and a code. Then we can autodelete the event but somehow pass the SimExitCause instance back. The method for getting that instance out of the event and back up to the simulate() loop for returning to python is not clear to me though, so maybe this is not a better idea. Just brainstorming. As far as the parallel queues goes, I did rewrite a bunch of this code, so it'd be nice not to make big changes at this point. If they're simple, though, I can easily just add the comparable change to my patch. I think the big thing standing in the way of checking my patch in is that I just use pthreads calls directly, and I think we at least want to provide some way of not requiring pthreads if you're not doing parallel simulation. We also may want to abstract that out to allow other threads packages (if there are any that would be useful to support). I'm happy to leave it be and don't want to stand in the way of your code. Do we care about things that aren't pthreads/posix complaint? Seems like every system we're going to run on should have it (because python requires it) and we shouldn't build infrastructure with no purpose (didn't you have a line like that at some point?). A question I'm interested in, is if there is a good c++ wrapper for pthreads that would work. Ali Links: ------ [1] mailto:[email protected] [2] mailto:[email protected]
_______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
