次の方法で共有


FSIA - Running CTS flows in Parallel

During the CTS flow development, some time there might be requirement to the CTS flows in parallel. This will help in developing the flows in for execution inner sub flows in parallel.

  

Thread operator is the vital component for running different set of flows in parallel. So CTS flow with parallel execution of flows can be built as shown above, please note that this is just one of the samples. So what you have in the flow is

  1. Common starting point, in the above flow it is just a database reader, but in other flows it can be any other starting point like file reader, range generator or any other type of reader available out of the box for CTS components. After common starting point then you can branch the flow execution to as many number of flows that you want to execute in parallel.
  2. Next in each branch if you want to start parallel flow execution with delay of sometime then you can use the timer operator, so that main thread of execution does not spins another thread for flow execution. For Each timer operator in each of the branch you can increase the delay time with equal intervals like 5 sec, 10 sec, 15 sec, 15 sec…….
  3. In each branch then you can put the thread operator. The Thread operator inserts an extra thread in the evaluation at the point it is located. Use of the Thread operator leads to increased throughput of the flow on multi-core servers. The operator can be used to increase the performance for a chain of CPU-intensive operators and for flows with multiple branches.
  4. Once the additional thread is spin off by the thread operator, then all the further execution for the CTS flows is responsible by the spin off thread, in this case we are using flow runner operator. So in this case additional spin off thread is responsible for the flow execution configured by the flow runner operator. Once the flow execution is completed by the flow runner operator which is been executed in thread context of additional thread which is spin off, flow execution returns to the main execution thread.
  5. Please not that flow executing in parallel will execute on different content engine node as available in round robin fashion.