Skip to content

Commit 4447d83

Browse files
author
pevnak
committed
working on lecture 10
1 parent 16f6468 commit 4447d83

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/src/lectures/lecture_10/lecture.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@ julia> @btime t();
348348
17.697 ms (776 allocations: 1.94 MiB)
349349
```
350350
with which we obtain the comparable speed to the `pmap` approach.
351-
!!! info
352-
### `remote_do` vs `remote_call`
351+
::: info "`remote_do` vs `remote_call`"
353352
Instead of `@spawnat` (`remote_call`) we can also use `remote_do` as foreach`(p -> remote_do(juliaset_channel_worker, p, instructions, results), workers)`, which executes the function `juliaset_channel_worker` at worker `p` with parameters `instructions` and `results` but does not return `Future` handle to receive the future results.
353+
:::
354354

355-
!!! info
356-
### `Channel` and `RemoteChannel`
355+
::: info "`Channel` and `RemoteChannel`""
357356
`AbstractChannel` has to implement the interface `put!`, `take!`, `fetch`, `isready` and `wait`, i.e. it should behave like a queue. `Channel` is an implementation if an `AbstractChannel` that facilitates a communication within a single process (for the purpose of multi-threadding and task switching). Channel can be easily created by `Channel{T}(capacity)`, which can be infinite. The storage of a channel can be seen in `data` field, but a direct access will of course break all guarantees like atomicity of `take!` and `put!`. For communication between proccesses, the `<:AbstractChannel` has to be wrapped in `RemoteChannel`. The constructor for `RemoteChannel(f::Function, pid::Integer=myid())` has a first argument a function (without arguments) which constructs the `Channel` (or something like that) on the remote machine identified by `pid` and returns the `RemoteChannel`. The storage thus resides on the machine specified by `pid` and the handle provided by the `RemoteChannel` can be freely passed to any process. (For curious, `ProcessGroup` `Distributed.PGRP` contains an information about channels on machines.)
357+
:::
358358

359359
In the above example, `juliaset_channel_worker` defined as
360360
```julia

0 commit comments

Comments
 (0)