Reputation: 141
Desired Outcome:
Define a mix of synchronous and asynchronous method relationships.
Example
Assume 4 methods, each containing a single process where:
The flow chart shown in the following link more clearly illustrates the desired synchronicity. Processes flow chart is like the following:
There is an async method, perhaps its usage would be appropriate here.
Note: I am new to SO and open to advice on writing higher quality questions.
Upvotes: 1
Views: 522
Reputation: 648
void ProcessA()
{
ProcessA1();
ProcessA2();
}
void ProcessB()
{
ProcessB1();
ProcessB2();
}
void LaunchProcesses()
{
Task aTask = Task.Run((Action)ProcessA); //You could also call use Task.Run(() => ProcessA());
Task bTask = Task.Run((Action)ProcessB);
aTask.Wait();
bTask.Wait();
}
Upvotes: 4