I have two different big tasks with several subtasks each. Each subtask has a child NSProgress which I update manually. Each big task hosts a parent NSProgress with several
[progress becomeCurrentWithPendingUnitCount:1.0]
// Perform subtask which generates the child `NSProgress`.
[progress resignCurrent]
calls at different times. Each of the two big task progress reporting works fine with this setup.
My problem is that I want to execute these two big tasks in parallel, and I want to track their progress as a whole. Is there any way to do this?
I have tried creating a NSProgress object at the outer level to wrap the two big task's NSProgress (so three NSProgress levels in total), but the problem is that the two tasks "fight" when updating progress. That is, one task could execute becomeCurrentWithPendingUnitCount: and then the other task could execute resignCurrent which causes an exception (since the second task's NSProgress is not current).
Making the two tasks sequential instead of parallel fixes the issue, but I really would like to execute them at the same time. Any ideas?