Lorenz Bucher
|
Inter-Thread Communication on Multicore Systems
|
Lorenz Bucher
10/29/2008 12:09 PM
post15672
|
Inter-Thread Communication on Multicore Systems
Hello,
I'm quite new to QNX and thread programming in general, and I have the following situation on my Intel quad-core machine
:
An interrupt on the parallel port is processed by an interrupt handler thread, which wakes up 4 worker threads, which
each have their processor affinity set to a specific core, so 1 worker thread per core.
The main idea is the following: The interrupt arrives -> 4 worker threads start processing *independent* data blocks at
the same time.
I've tried out several mechanisms for this "wake up" of the worker threads: condvar/mutex, barrier, sleepon. If I use
sleepon for example, I still need a shared variable between the worker threads, which I need to access using a lock/
unlock sequence. This results in the worker threads not starting at the same time, as each one needs exclusive access to
the mutex for a short period time. The workers start about 10us staggered from each other, even though they could all
start at the same time.
Can anyone give me some suggestions as to which synchronization mechanism to use for this application? I've been
thinking about using atomic operations to toggle a flag or going "down" to IPC...
Thanks in advance for any hints,
~Lorenz
|
|
|