Pages

Thursday, February 21, 2013

Accessing Input Queue of a Pipeline Stage

On the today’s “Multithreading” workshop, a request popped up – a potential OmniThreadLibrary user asked how to access an input queue of a specific pipeline stage. As this was the second time this request was presented, I decided to implement this feature. It turned out that all available information was already present and I just had to expose it.
As of the revision 1263, IOmniPipeline interface defines property PipelineStage which gives you access to an IOmniPipelineStage information block for a specific stage (first stage having index zero).
type
  IOmniPipeline = interface
    //...
    property PipelineStage[idxStage: integer]: IOmniPipelineStage 
      read GetPipelineStage;
  end;

This interface implements two properties, Input and Output, which will give you access to the stage’s pipelines. [At the moment I have no idea why accessing the Output pipeline could be useful, though.]

type
  IOmniPipelineStage = interface ['{DFDA7A07-6B28-4AA6-9218-59D3DF9C4B8E}']
    //...
    property Input: IOmniBlockingCollection read GetInput;
    property Output: IOmniBlockingCollection read GetOutput;
  end;

This extension has not been tested much so please report any problems through the forum.

No comments:

Post a Comment