Re: [Gems-users] Thread migration in Gems


Date: Thu, 6 Aug 2009 19:35:54 -0500
From: Dan Gibson <degibson@xxxxxxxx>
Subject: Re: [Gems-users] Thread migration in Gems
Hi Jianghao,

1) Please don't reply directly to gems-users participants unless they ask you to do so -- I'm directing this thread back to gems-users so others can benefit from it.

2) Don't think about thread migration 'in GEMS'. Think about it on a real machine -- thats what we're simulating, after all. What causes thread migration? Well, random happenstance does. Another thing that causes it is when a thread tries to bind to a processor on which it is not currently running (of course, this assumes the OS respects thread binding...which I have never confirmed). So, since your target is look into sched_setaffinity(). Modify your application binary to fork a thread and call it.

Regards,
Dan

On Thu, Aug 6, 2009 at 7:30 PM, Jianghao Guo <guojh.uc@xxxxxxxxx> wrote:

Hi Dan:

 

Thanks for your reply.

I started to use Gems just a couple of days ago.

What I want to test is to migrate my program from one core to another idle core, for load balance purpose.

From your suggestion, it seems it’s not doable by swapping cpu registers.

 

Could you give me some advice about how to do this in Gems?

 

Thanks

JH

 

 

If your work relies on having system-level effects of migration, I recommend you have a second thread in your application explicitly bind to cpu0 while your 'main' thread is doing work. You can even semi-synchronize the event with a CV if you so choose.

 

I would NOT suggest modifying CPU registers directly.

 

Regards,

Dan

 




--
http://www.cs.wisc.edu/~gibson [esc]:wq!
[← Prev in Thread] Current Thread [Next in Thread→]