Fast inter-thread communication mechanism

Stan picture Stan · Mar 8, 2010 · Viewed 15.5k times · Source

I need a fast inter-thread communication mechanism for passing work (void*) from TBB tasks to several workers which are in running/blocking operations. Currently I'm looking into using pipe()+libevent. Is there a faster and more elegant alternative for use with Intel Threading Building Blocks?

Answer

Jason B picture Jason B · Mar 8, 2010

You should be able to just use standard memory with mutex locks since threads share the same memory space. The pipe()+libevent solution seems more fitting for interprocess communication where each process has a different memory space.