-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Logger fails silently when logging from multithreaded for loop / map, can't communicate with logger afterward.
Julia default logger works well in a similar situation.
MWE:
using TensorBoardLogger
using Logging
tblogger = TBLogger("MWE_tblogger_threads", min_level=Logging.Info)
with_logger(tblogger) do
for i in 1:10
@info "blah" i^2
end
@info "finished sequential" finished=true
end # works well
with_logger(tblogger) do
Threads.@threads for i in 1:10
println(i^2) # no logging here
end
@info "finished threads" finished=true
end # works well too
with_logger(tblogger) do
Threads.@threads for j in 1:10
@info "blah" j^2
end
@info "finished threads" finished=false
end # silently fails, and doesn't log anything
with_logger(tblogger) do
@info "can't communicate" something=1
end # can't communicate with logger afterward
Metadata
Metadata
Assignees
Labels
No labels