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 - Inter-Thread Communication on Multicore Systems: Page 1 of 13 (13 Items)
   
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