Chip Bagwell
|
What is the cheapest way to lock the current thread to it's current core - PPC multi-core arch specific
|
Chip Bagwell
06/15/2011 11:11 AM
post86640
|
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.
|
|
|