Running Multiple Instances of the Same Batch Program

By varying the instanceID programmatically, most obviously by setting it based on a parameter passed in, it is possible to run multiple instances of the same chunker implementation at the same. This would also require a similar mechanism to set the instanceID of the stream instance(s) as this ID acts as the pairing mechanism between the two.

However, while this is technically possible, care must be taken that this varying of the instanceID also varies the set of processing units picked by the chunker. The situation can arise where streams with different instance IDs end up processing the same unit at the same time and contention and/or cross-locking can occur.