var tasks0 = new BlockingCollection<object>(new ConcurrentQueue<object>());
tasks0.Add(Fetch(APCounter));
tasks0.Add(Decode(APCounter));
tasks0.Add(ALURes(APCounter));
tasks0.Add(Memory(APCounter));
tasks0.Add(WriteB(APCounter));
var tasks1 = new BlockingCollection<object>(new ConcurrentQueue<object>());
tasks1.Add(Fetch(APCounter+1));
tasks1.Add(Decode(APCounter + 1));
tasks1.Add(ALURes(APCounter + 1));
tasks1.Add(Memory(APCounter + 1));
tasks1.Add(WriteB(APCounter + 1));
I don’t want it execute the functions being added now. I’ll do that manually later using the business logic. !!!
As others have said, you’ll need to store a list of Delegates, or something similar, to do what you want. You are executing those functions and then storing the result in a blocking collection. The first thing that you need to do is change the generic type on the blocking collection to:
Then to actually execute the functions: