Skip to content

Commit

Permalink
Update definitions.py to match CanonicalABI.md (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Jul 3, 2024
1 parent 6e331e8 commit 5d5f4ee
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions design/mvp/CanonicalABI.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,6 @@ another task:
return self.process_event(self.events.get_nowait())
```

Additionally, the current task can cooperatively allow the runtime to switch to
another task (e.g., to maintain concurrency during a long-running compute-bound
task) by calling `yield_` (via `canon task.yield`, defined below):
```python
async def yield_(self):
self.inst.thread.release()
await asyncio.sleep(0)
await self.inst.thread.acquire()
```

Lastly, when a task exists, the runtime enforces the guard conditions mentioned
above and releases the `thread` lock, allowing other tasks to start or make
progress.
Expand Down

0 comments on commit 5d5f4ee

Please sign in to comment.