Even though people will always tell you to upgrade to the latest version, this is the reason I hate updating old but working stuff… So since I updated from 1.0 to 1.3 SharedArrays doesn’t work anymore.
using SharedArrays
works, but when I write
p=SharedArray{Int64}(10)
Julia hangs but seems to do something in the background. After some time I’m done waiting and will abort with ctrl+c to get this error
ERROR: LoadError: InterruptException:
...and 3 more exception(s).
Stacktrace:
[1] sync_end(::Array{Any,1}) at .\task.jl:300
[2] macro expansion at .\task.jl:319 [inlined]
[3] remotecall_eval(::Module, ::Array{Int64,1}, ::Expr) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\macros.jl:217
[4] top-level scope at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\macros.jl:201
[5] include at .\boot.jl:328 [inlined]
[6] include_relative(
SYSTEM (REPL): showing an error caused an error
ERROR: InterruptException:
Stacktrace:
[1] sigatomic_end at .\c.jl:425 [inlined]
[2] uv_write(::Base.TTY, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:931
[3] unsafe_write(::Base.TTY, ::Ptr{UInt8}, ::UInt64) at .\stream.jl:1007
[4] unsafe_write(::REPL.Terminals.TTYTerminal, ::Ptr{UInt8}, ::UInt64) at .\io.jl:310 (repeats 2 times)
[5] macro expansion at .\gcutils.jl:91 [inlined]
[6] write at .\strings\io.jl:186 [inlined]
[7] print at .\strings\io.jl:188 [inlined]
[8] #with_output_color#707(::Bool, ::typeof(Base.with_output_color), ::Function, ::Symbol, ::IOContext{REPL.Terminals.TTYTerminal}, ::String) at .\util.jl:383
[9] #with_output_color at .\none:0 [inlined]
[10] #printstyled#708 at .\util.jl:397 [inlined]
[11] #printstyled at .\none:0 [inlined]
[12] show_tuple_as_call(::IOContext{REPL.Terminals.TTYTerminal}, ::Symbol, ::Type) at .\show.jl:1522
[13] show_spec_linfo(::IOContext{REPL.Terminals.TTYTerminal}, ::Base.StackTraces.StackFrame) at .\stacktraces.jl:262
[14] #show#9(::Bool, ::typeof(show), ::IOContext{REPL.Terminals.TTYTerminal}, ::Base.StackTraces.StackFrame) at .\stacktraces.jl:272
[15] #show at .\none:0 [inlined]
[16] #show_trace_entry#673(::String, ::typeof(Base.show_trace_entry), ::IOContext{REPL.Terminals.TTYTerminal}, ::Base.StackTraces.StackFrame, ::Int64) at .\errorshow.jl:483
[17] (::Base.var"#kw##show_trace_entry")(::NamedTuple{(:prefix,),Tuple{String}}, ::typeof(Base.show_trace_entry), ::IOContext{REPL.Terminals.TTYTerminal}, ::Base.StackTraces.StackFrame, ::Int64) at .\none:0
[18] show_backtrace(::IOContext{REPL.Terminals.TTYTerminal}, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at .\errorshow.jl:586
[19] #showerror#656(::Bool, ::typeof(showerror), ::IOContext{REPL.Terminals.TTYTerminal}, ::CompositeException, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at .\errorshow.jl:79
[20] (::Base.var"#kw##showerror")(::NamedTuple{(:backtrace,),Tuple{Bool}}, ::typeof(showerror), ::IOContext{REPL.Terminals.TTYTerminal}, ::CompositeException, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at .\none:0
[21] #showerror#659(::Bool, ::typeof(showerror), ::IOContext{REPL.Terminals.TTYTerminal}, ::LoadError, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at .\errorshow.jl:85
[22] (::Base.var"#kw##showerror")(::NamedTuple{(:backtrace,),Tuple{Bool}}, ::typeof(showerror), ::IOContext{REPL.Terminals.TTYTerminal}, ::LoadError, ::Array{Union{Ptr{Nothing}, Base.InterpreterIP},1}) at .\none:0
[23] show_exception_stack(::IOContext{REPL.Terminals.TTYTerminal}, ::Array{Any,1}) at .\errorshow.jl:649
[24] display_error(::IOContext{REPL.Terminals.TTYTerminal}, ::Array{Any,1}) at .\client.jl:102
[25] #invokelatest#1 at .\essentials.jl:709 [inlined]
[26] invokelatest at .\essentials.jl:708 [inlined]
[27] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:151
[28] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:141
[29] (::REPL.var"#do_respond#38"{Bool,REPL.var"#48#57"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:719
[30] #invokelatest#1 at .\essentials.jl:709 [inlined]
[31] invokelatest at .\essentials.jl:708 [inlined]
[32] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\LineEdit.jl:2306
[33] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:1045
[34] run_repl(::REPL.AbstractREPL, ::Any) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\REPL\src\REPL.jl:201
[35] (::Base.var"#770#772"{Bool,Bool,Bool,Bool})(::Module) at .\client.jl:382
[36] #invokelatest#1 at .\essentials.jl:709 [inlined]
[37] invokelatest at .\essentials.jl:708 [inlined]
[38] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at .\client.jl:366
[39] exec_options(::Base.JLOptions) at .\client.jl:304
[40] _start() at .\client.jl:460
and some other times (not always the same error)
ERROR: InterruptException:
Stacktrace:
[1] poptaskref(::Base.InvasiveLinkedListSynchronized{Task}) at .\task.jl:660
[2] wait() at .\task.jl:667
[3] wait(::Base.GenericCondition{ReentrantLock}) at .\condition.jl:106
[4] take_buffered(::Channel{Any}) at .\channels.jl:400
[5] take!(::Channel{Any}) at .\channels.jl:394
[6] take!(::Distributed.RemoteValue) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:595
[7] #remotecall_fetch#145(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(remotecall_fetch), ::Function, ::Distributed.Worker, ::Distributed.RRID, ::Vararg{Any,N} where N) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:386
[8] remotecall_fetch(::Function, ::Distributed.Worker, ::Distributed.RRID, ::Vararg{Any,N} where N) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:382
[9] #remotecall_fetch#148(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(remotecall_fetch), ::Function, ::Int64, ::Distributed.RRID, ::Vararg{Any,N} where N) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:417
[10] remotecall_fetch at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:417 [inlined]
[11] call_on_owner at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:490 [inlined]
[12] wait at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\Distributed\src\remotecall.jl:511 [inlined]
[13] #_#3(::Bool, ::Array{Int64,1}, ::Type{SharedArray{Int64,1}}, ::Tuple{Int64}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:137
[14] SharedArray at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:105 [inlined]
[15] #_#10 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:161 [inlined]
[16] SharedArray at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:161 [inlined]
[17] #_#13 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:167 [inlined]
[18] SharedArray{Int64,N} where N(::Int64) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.3\SharedArrays\src\SharedArrays.jl:167
[19] top-level scope at REPL[4]:1
Since I’m already here: Is SharedArrays the prefered option when parallelizing for loops?