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,
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.
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.)