@@ -423,7 +423,7 @@ threshold, below which the computation can be done sequentially.
423423## Bounded Channels
424424
425425Channels 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
427427come in two flavours:
428428
429429* ** Bounded** : buffered channels with a fixed size. A channel with buffer size
@@ -460,9 +460,9 @@ let _ =
460460```
461461
462462The 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
464464with 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
466466with the same example as above just by changing the buffer size to 1.
467467
468468``` ocaml
@@ -516,11 +516,11 @@ let recv c =
516516let _ =
517517 let senders = Array.init num_domains
518518 (fun _ -> Domain.spawn(fun _ -> send c )) in
519- let recievers = Array.init num_domains
519+ let receivers = Array.init num_domains
520520 (fun _ -> Domain.spawn(fun _ -> recv c)) in
521521
522522 Array.iter Domain.join senders;
523- Array.iter Domain.join recievers
523+ Array.iter Domain.join receivers
524524```
525525
526526` (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
575575tasks. We'll pay attention to two functions here: ` create_work ` and ` worker ` .
576576
577577` 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
580580encounters a Quit message, which is why we send ` Quit ` messages to the channel,
581581indicating that the worker can terminate.
582582
0 commit comments