for (int i = 0; i < process->numCpus(); ++i) {
ExecContext *xc = process->execContexts[i];
if (xc->status() == ExecContext::Suspended) {
// inactive context... grab it
init_exec_context(xc, attrp, uniq_val);
...
What's tricky here is that process->numCpus() is a bit of a misnomer since it really is giving you the number of thread contexts available in the system. In a multicore simulation with one thread per CPU then you are fine. But in a multicore simulation where there are multiple threads per CPU you would also need to check the 'ExecContext' "cpu_id" for whatever scheduling purposes are appropriate.
So I guess your 'fork' implementation might have a similar loop with some of the aforementioned changes.
Hi,I want to use the m5 simulator to learn how multi-threaded matrix
multiplication code will work on a multi-core architecture. Is it
possible for me to specify how the various threads of this code should
be mapped to the different cores? Or, does m5 have any special library
calls to spawn off threads to different cores (eg: equivalent of a
fork() call).regards-Rajdeep__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
--
--
Korey LaMar Sewell
University of Michigan
Computer Science & Engineering
Ph.D Student
------
``Experience is not what happens to you. It is what you do with what happens
to you.''
_______________________________________________ m5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
