Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freezes silently on multithreading #106

Open
michelangelo21 opened this issue Aug 4, 2021 · 0 comments
Open

Freezes silently on multithreading #106

michelangelo21 opened this issue Aug 4, 2021 · 0 comments

Comments

@michelangelo21
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant