executing function conditionally and in parrallel
I have some code that currently looks somewhat like this:
Parallel.Invoke(
MyFunction1,
MyFunction2,
MyFunction3,
MyFunction4,
MyFunction5);
This works really well. Now I also have a list of bytes that's passed in
as a parameter and that looks like this:
TheList = new List<Byte>{1, 3, 5, 6 };
I want to execute functions based on the content of that list. Let's say
that each value is associated to a certain function name like this:
1: MyFunction1,
2: MyFunction2,
...
6: MyFunction6
The actual names of these function is different.
How do I change my code so that the function calls get executed in
parallel and conditionally to the content of the list of bytes?
Thanks.
No comments:
Post a Comment