I am seeing the following strange behavior where Julia seems to get stuck and becomes unresponsive.
Generate some data and save as .csv:
using CSV, DataFrames
d = DataFrame(rand(10000,10), :auto)
CSV.write("test.csv", d)
Now when I execute the following code Julia gets stuck after 3-4 times on my machine. This seems to be related to the threaded loop - when I remove the threads macro the code executes fine many times.
df = CSV.read("test.csv", DataFrame)
Threads.@threads for n in 1:300
end
Can anyone reproduce this? I am on Julia 1.10.4 and CSV v0.10.14
As weird as it may sound, the original version with the empty loop at the end was what I intended. If I execute that second cell multiple times, Julia usually gets stuck after 3-4 times. Would you mind giving that a try?
It’s certainly something within VS code but I don’t think it is just the visual. In a more complex example I am saving information to disk, and once VS code gets stuck the creating of files stops.
Thanks for checking! Does it also work fine when executing multiple (>4) times in VS Code (e.g., pressing Alt+Enter multiple times with the second part of the code in a script)?
As a Julia script (.jl) it always executes fine, no matter how often I spam alt/ctrl + enter.
As a Jupyter notebook (.ipynb),
When repeatedly running the second cell (CSV.read, @threads) at a normal pace using ctrl+enter, ctrl+alt+enter, or the run icon, everything works fine.
When spamming ctrl(+alt)+enter, say 10 times per second during 10 seconds, everything is still fine.
When spamming the run icon, I can get VS Code stuck. I’m not entirely sure if I am in fact clicking run, or stop (which the run icon turns into when a cell is running), as the cell normally finishes execution basically immediately, but in any case the cell execution certainly does not stop. I can still run other cells (i.e. the first cell with the CSV.write), but to run the second cell again, I need to restart VS Code.