"Inventing" a task at a pipeline stage

"Inventing" a task at a pipeline stage

kankamuso's picture

Hi,

I was wondering if something like this would work:

On a pipeline stage I create a POSIX thread and leave it running on the baclground. Then the pipeline stagereturns a NULL to the next stage. Is it possible for the living thread, somehow, to send a new task to the next stage on the pipeline?. Is the pipeline completely closed from the begining to the end?.

I am trying to do this because I have found problems with pipeline stages trying to run things on the background to leave a free CPU for other token to arrive...

Thanks in advance,

Jose.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Kirill Rogozhin (Intel)'s picture

Hi Jose,

The token passed between pipeline stages can't be inserted from separate thread in the middle of pipeline. The token is passed from first filter to second, than third, etc.
What task are you trying to pass from POSIX thread to pipeline stage? If it is just some data, you can extract and use it in some filter. But this filter should get a token from previous filter, otherwise it will wait for it and will not execute the code taking the data from POSIX thread.

Maybe it's better to focus on initial problem. Can you describe in details what problem do you have with pipeline stages? Code sample would be very appreciated.

Regards,
Kirill

jimdempseyatthecove's picture

What is your pipeline doing when it is not throwing work into the POSIX thread(s)?
What do you want to happen if the pipeline runs out of input prior to the additional POSIX thread(s) complete?

A full description of your problem will save us some time in offering you a useful solution. (And get you a usable answer sooner.)

Jim Dempsey

www.quickthreadprogramming.com

Login to leave a comment.