Multiprocessing and Fork

less than 1 minute read

multiprocessing in Windows

not working sinc

system fork ν”„λ‘œμ„ΈμŠ€μ˜ 사본을 λ§Œλ“œλŠ”κ²Œ fork 라고 ν•œλ‹€. μžμ‹μ„ λ§Œλ“€κΈ° μœ„ν•΄ fork ν•˜λŠ” 것이닀.

linuxλŠ” κ°€λŠ₯ν•˜λ‹€. ν•˜μ§€λ§Œ μœˆλ„μš°μ—μ„œλŠ” λΆˆκ°€λŠ₯ν•˜λ‹€.

이와 같은 이유둜 μœˆλ„μš°μ—μ„œλŠ” dataloader argument num_workers = 0 만 μ‚¬μš©κ°€λŠ₯ν•˜λ‹€.

fork is insecure ν•˜λ‹€.

https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf

multiprocessing not working in Windows: https://purplechip.tistory.com/36 https://medium.com/@grvsinghal/speed-up-your-python-code-using-multiprocessing-on-windows-and-jupyter-or-ipython-2714b49d6fac
https://www.pythonforthelab.com/blog/differences-between-multiprocessing-windows-and-linux/

Tags:

Categories:

Updated:

Leave a comment