This works on my PC, could it be, that you only run julia with one thread?
Make sure Threads.nthreads() > 1.
If there’s only one thread, you will need a yield to allow any other task to work.
Also, be aware that GLMakie isn’t threadsafe, so you can’t just update any plot from another thread!
You will need to push the updates to a channel, or something like that:
function mwe()
channel = Channel(Inf) do channel
fig = GLMakie.Figure()
gl = fig[1, 1] = GridLayout()
ax = Axis(gl[2, 1])
t = Toggle(gl[1, 1], active=false, tellwidth=false)
splot = scatter!(ax, rand(Point2f, 10))
display(fig)
task = @async for update! in channel
update!(splot) # pass Makie objects in here
end
wait(task)
end
Threads.@spawn begin
while true
push!(channel, (plot)-> begin
plot[1] = rand(Point2f, 10)
end)
sleep(1/25)
end
end
end
mwe()