I am having trouble modeling one particular use case.
- Task 1 and Task 2 are spawned in parallel.
- Task 1 is repeated multiple times based on a condition.
- Once the first Task 1 is completed, we must wait for Task 2 completion before continuing. Which means first iteration of Task 1 will wait (if Task 2 isn't yet complete), but subsequent iterations will continue since Task 2 is already completed.
Here is my try at modeling:
The issues I see with this model:
1- If Task 2 is completed before the first Task 1 is completed, the Event will be thrown, but not catched. And once Task 1 is complete, it will wait for event indefinitely.
2- On iterations 2+ of Task 1, it will wait indefinitely for the event as it is thrown only once.
Any help on how to model this would be appreciated, thanks !
