@@ -423,7 +423,7 @@ threshold, below which the computation can be done sequentially.
423
423
## Bounded Channels
424
424
425
425
Channels act as medium to communicate data between domains. They can be shared
426
- between multiple sending and recieving domains. Channels in Multicore OCaml
426
+ between multiple sending and receiving domains. Channels in Multicore OCaml
427
427
come in two flavours:
428
428
429
429
* ** Bounded** : buffered channels with a fixed size. A channel with buffer size
@@ -460,9 +460,9 @@ let _ =
460
460
```
461
461
462
462
The above example would be essentially blocking indefinitely because the ` send `
463
- does not have a corresponding recieve . If we instead create a bounded channel
463
+ does not have a corresponding receive . If we instead create a bounded channel
464
464
with buffer size n, it can store up to [ n] objects in the channel without a
465
- corresponding recieve , exceeding which the sending would block. We can try it
465
+ corresponding receive , exceeding which the sending would block. We can try it
466
466
with the same example as above just by changing the buffer size to 1.
467
467
468
468
``` ocaml
@@ -516,11 +516,11 @@ let recv c =
516
516
let _ =
517
517
let senders = Array.init num_domains
518
518
(fun _ -> Domain.spawn(fun _ -> send c )) in
519
- let recievers = Array.init num_domains
519
+ let receivers = Array.init num_domains
520
520
(fun _ -> Domain.spawn(fun _ -> recv c)) in
521
521
522
522
Array.iter Domain.join senders;
523
- Array.iter Domain.join recievers
523
+ Array.iter Domain.join receivers
524
524
```
525
525
526
526
` (Domain.self () :> int) ` returns the id of current domain.
@@ -575,8 +575,8 @@ We have created an unbounded channel `c` which will act as a store for all the
575
575
tasks. We'll pay attention to two functions here: ` create_work ` and ` worker ` .
576
576
577
577
` create_work ` takes an array of tasks and pushes all elements of tasks to the
578
- channel ` c ` . The ` worker ` function recieves tasks from the channel and executes
579
- a function f with the recieved task as parameter. It keeps recursing until it
578
+ channel ` c ` . The ` worker ` function receives tasks from the channel and executes
579
+ a function f with the received task as parameter. It keeps recursing until it
580
580
encounters a Quit message, which is why we send ` Quit ` messages to the channel,
581
581
indicating that the worker can terminate.
582
582
0 commit comments