You ever just add debug logs to the #Python standard library because it doesn’t have logs where they’re needed?
(I’m working with a heavily multi-processed program so pdb
won’t do shit.)
You ever just add debug logs to the #Python standard library because it doesn’t have logs where they’re needed?
(I’m working with a heavily multi-processed program so pdb
won’t do shit.)
Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
in reply to Doughnut Lollipop 【記録係】:blobfoxgooglymlem: • • •Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
in reply to Doughnut Lollipop 【記録係】:blobfoxgooglymlem: • • •Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
in reply to Doughnut Lollipop 【記録係】:blobfoxgooglymlem: • • •I think I can fix it by using a Unix datagram socket to forward the logs to the logger thread, rather than trying to get
multiprocessing.Queue
to be inherited by child processes and their child processes. When I got rid of the latter logging approach, it stopped getting stuck.All of this because of the #GIL. #Python
mr64bit
in reply to Doughnut Lollipop 【記録係】:blobfoxgooglymlem: • • •Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
in reply to mr64bit • • •spawn
context, though.Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
in reply to Doughnut Lollipop 【記録係】:blobfoxgooglymlem: • • •Never, ever, use the
fork
context inmultiprocessing
. POSIX OSes (aside from macOS) have that as the default. Always use thespawn
context!Of course, unless you have an extreme edge case. (Yes, the names are funny. )
#Python #multiprocessing
multiprocessing — Process-based parallelism
Python documentationNeil E. Hodges reshared this.