Skip to content

Commit 4419966

Browse files
committed
TUTORIAL.md add links to PRIMITIVES.md
1 parent a3a0685 commit 4419966

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

TUTORIAL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ may be found [here](./PRIMITIVES.md).
366366

367367
## 3.1 Lock
368368

369-
This describes the use of the official `Lock` primitive.
369+
This describes the use of the official `Lock` primitive. [Full details.](./PRIMITIVES.md#32-class-lock)
370370

371371
This guarantees unique access to a shared resource. In the following code
372372
sample a `Lock` instance `lock` has been created and is passed to all coros
@@ -416,7 +416,7 @@ is significantly less efficient than the official class.
416416
This provides a way for one or more coros to pause until another flags them to
417417
continue. An `Event` object is instantiated and made accessible to all coros
418418
using it. Coros waiting on the event issue `await event` whereupon execution
419-
pauses until another issues `event.set()`.
419+
pauses until another issues `event.set()`. [Full details.](./PRIMITIVES.md#33-class-event)
420420

421421
This presents a problem if `event.set()` is issued in a looping construct; the
422422
code must wait until the event has been accessed by all waiting coros before
@@ -476,7 +476,7 @@ This enables multiple coros to rendezvous at a particular point. For example
476476
producer and consumer coros can synchronise at a point where the producer has
477477
data available and the consumer is ready to use it. At that point in time the
478478
`Barrier` can optionally run a callback before releasing the barrier and
479-
allowing all waiting coros to continue.
479+
allowing all waiting coros to continue. [Full details.](./PRIMITIVES.md#34-class-barrier)
480480

481481
The callback can be a function or a coro. In most applications a function is
482482
likely to be used: this can be guaranteed to run to completion before the
@@ -509,6 +509,7 @@ A semaphore limits the number of coros which can access a resource. It can be
509509
used to limit the number of instances of a particular coro which can run
510510
concurrently. It performs this using an access counter which is initialised by
511511
the constructor and decremented each time a coro acquires the semaphore.
512+
[Full details.](./PRIMITIVES.md#35-class-semaphore)
512513

513514
The easiest way to use it is with a context manager:
514515

@@ -525,7 +526,7 @@ An example is the `semaphore_test` function in `asyntest.py`.
525526

526527
This works identically to the `Semaphore` class except that if the `release`
527528
method causes the access counter to exceed its initial value, a `ValueError`
528-
is raised.
529+
is raised. [Full details.](./PRIMITIVES.md#351-class-boundedsemaphore)
529530

530531
###### [Contents](./TUTORIAL.md#contents)
531532

0 commit comments

Comments
 (0)