fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

Investigate use of `@async` instead of `Threads.@spawn` in Pluto #2779

Closed fonsp closed 6 months ago

fonsp commented 6 months ago

In Pluto's source code we have lots of @async but apparently that's bad!

https://docs.julialang.org/en/v1/base/parallel/#Base.@async

We should investigate switching to Threads.@spawn. I just did a search-replace and it "feels faster"

One concern is that most people just run julia which will only have one thread. Does that mean that Threads.@spawn and @async are equivalent?

fonsp commented 6 months ago

@pankgeorg What do you think? :)

pankgeorg commented 6 months ago

We need to protect the server state with a thread safe lock, so this is not a trivial change. I would suggest postponing it until we can dump HTTP.jl over something more thread safe.

fonsp commented 6 months ago

Anything else from the call today? Let's close with the "One day" label?

pankgeorg commented 6 months ago

We only talked about this and memory management