Skip to content

Commit 6e93221

Browse files
committed
TUTORIAL.md Clarify consequence of Event.clear.
1 parent 0c86db0 commit 6e93221

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

v3/docs/TUTORIAL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,12 @@ be queued for execution. Note that the synchronous sequence
669669
event.set()
670670
event.clear()
671671
```
672-
will cause any tasks waiting on the event to resume in round-robin order.
672+
will cause any tasks waiting on the event to resume in round-robin order. In
673+
general the waiting task should clear the event, as in the `waiter` example
674+
above. This caters for the case where the waiting task has not reached the
675+
event at the time when it is triggered. In this instance, by the time the task
676+
reaches the event, the task will find it clear and will pause. This can lead to
677+
non-deterministic behaviour if timing is marginal.
673678

674679
The `Event` class is an efficient and effective way to synchronise tasks, but
675680
firmware applications often have multiple tasks running `while True:` loops.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy