Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - What is the cheapest way to lock the current thread to it's current core - PPC multi-core arch specific: Page 1 of 5 (5 Items)
   
What is the cheapest way to lock the current thread to it's current core - PPC multi-core arch specific  
I know you can use ThreadCtl() to set the CPU runmask for a given thread, but that is a QNX kernel call and is fairly 
expensive.  Once the desired thread is running on a given CPU core, can if I disable external interrupts (EE bit in MSR)
 on that core to keep that thread from being migrated to a different core if it is pre-empted by a higher priority 
thread?  Also I believe I will have to ensure there are no QNX system calls within the scope of the disabling of 
interrupts to avoid Neutrino from re-enabling interrupts without my knowledge.  This seems much cheaper than issuing two
 ThreadCtl() calls, one to lock to the current core, one to unlock and allow the thread to run on all cores.

The thread in question is trying to utilize a memory-mapped region of on-chip registers.  Each core has it's own set of 
on-chip registers mapped into the process space.  Once the thread starts working with the registers, I need to make sure
 it does not migrate to a different thread until the critical section of code using those registers is complete.  Also 
the thread in question is rather high in priority relative to other threads in the process, but not the highest thread 
priority in the process.