julia icon indicating copy to clipboard operation
julia copied to clipboard

Make threadcall gc safe

Open gbaraldi opened this issue 1 year ago • 3 comments

threadcall cannot call julia code. But due to thread adoption it currently is not marked gc safe. Which means that a blocking call will cause a hang in the GC

gbaraldi avatar Oct 01 '24 14:10 gbaraldi

Someone should finish https://github.com/JuliaLang/julia/pull/49933

vchuravy avatar Oct 01 '24 14:10 vchuravy

Just to confirm, is it safe to call jl_gc_safe_{enter/leave}() within a GC safepoint? Asking because I'll probably keep my hack of manually calling it to support current/older Julia versions.

JamesWrigley avatar Oct 01 '24 15:10 JamesWrigley

"GC safepoint" are singular points in time.

GC safe regions are spans in time, and yes it is legal to to nest safe regions.

vchuravy avatar Oct 01 '24 16:10 vchuravy