Please sign in to comment.
Fix the wait op for threads
A task scheduled on another thread will get cloned to be local to this thread. The two task objects are then linked by a "partner" pointer. To wait for a task of another thread one now only has to add the current task to the waiter list of the original task object. A task will schedule its waiters when it is done and now will also see if the partner task has any waiters and schedule them on the partner's interp. In addition the main thread will now no longer exit as long as tasks on other threads are running (an explicit exit op does still work however). The main thread's tasks could still be waiting for other tasks to finish.
- Loading branch information...
Showing with 99 additions and 42 deletions.