Re: how to get current cpu id
Matthias Lange <[email protected]>
| Newsgroups | gmane.comp.micro-kernel.l4.devel |
|---|---|
| Message-ID | <20140515060326.GA9109@triton> |
On Wed, May 14, 2014 at 07:27:16PM -0400, Yuxin Ren wrote: > Thank you for your reply. > I understand you. But I still have a question. > How can I know when the thread finish its migration? > In my scenario, master thread creates children threads and then migrate > then to other cores. > It waits until all children finish migration. > The problem is how does master thread guarantee all children finish > migration. You can have a look at the migrate example in examples/sys/migrate. Migration is synchronous, so when the call to the scheduler proxy has finished the thread has been migrated. Matthias. > > Thank you. > > > On Wed, May 14, 2014 at 7:14 PM, Adam Lackorzynski < > [email protected]> wrote: > > > On Tue May 13, 2014 at 17:05:34 -0800, Yuxin Ren wrote: > > > How can I get the id of cpu(core) the current thread is running on? > > > > The system does not do migrate threads between CPUs on its own, so your > > program is running on CPU0. And from that point (in a simple scenario) > > programs control themselves where they migrate to, so they know where > > they are running on. > > > > > > Adam > > -- > > Adam [email protected] > > Lackorzynski http://os.inf.tu-dresden.de/~adam/ > > > > _______________________________________________ > > l4-hackers mailing list > > [email protected] > > http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers > > > _______________________________________________ > l4-hackers mailing list > [email protected] > http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers -- Matthias Lange, [email protected], +49 - 351 - 41 88 86 14 Kernkonzept GmbH. Sitz: Dresden. Amtsgericht Dresden, HRB 31129. Geschäftsführer: Dr.-Ing. Michael Hohmuth