Skip to content

Commit

Permalink
added homework
Browse files Browse the repository at this point in the history
  • Loading branch information
pevnak committed Dec 8, 2023
1 parent 55a15e1 commit c8c965b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ lecture_09 = [
lecture_10 = [
"Lecture" => "./lecture_10/lecture.md"
"Lab" => "./lecture_10/lab.md"
"Homework" => "./lecture_10/hw.md"
]

makedocs(;
Expand Down
4 changes: 2 additions & 2 deletions docs/src/lecture_10/lecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ Let's now try to speed-up the calculation using multi-threadding. `Julia v0.5` h
function juliaset_static(x, y, n=1000)
c = x + y*im
img = Array{UInt8,2}(undef,n,n)
Threads.@threads for j in 1:n
Threads.@threads :static for j in 1:n
juliaset_column!(img, c, n, j)
end
return img
Expand Down Expand Up @@ -697,7 +697,7 @@ end |> DataFrame
We observe that the minimum is for `basesize = 32`, for which we got `3.8932×` speedup.

## Garbage collector is single-threadded
Keep reminded that while threads are very easy very convenient to use, there are use-cases where you might be better off with proccess, even though there will be some communication overhead. One such case happens when you need to allocate and free a lot of memory. This is because Julia's garbage collector is single-threadded. Imagine a task of making histogram of bytes in a directory.
Keep reminded that while threads are very easy very convenient to use, there are use-cases where you might be better off with proccess, even though there will be some communication overhead. One such case happens when you need to allocate and free a lot of memory. This is because Julia's garbage collector is single-threadded (in 1.10 it is now partially multi-threaded). Imagine a task of making histogram of bytes in a directory.
For a fair comparison, we will use `Transducers`, since they offer thread and process based paralelism
```julia
using Transducers
Expand Down

0 comments on commit c8c965b

Please sign in to comment.