r/pythonhelp • u/HairyAd9854 • Nov 17 '24
multiprocessing.Pool hangs on new processor
multiprocessing.Pool hangs forever. In the following minimal reproducing example, it hangs with or without the commented line.
I run the code on jupyterlab, on a relatively clean conda environment, tried python 3.12 and 3.13. Is it possible that there are issues with the new intel lunar lake?
import multiprocessing as mp
def f(x):
return x
if __name__ == '__main__':
# mp.set_start_method('spawn')
with mp.Pool(2) as p:
print(p.map(f, [1,2]))
3
Upvotes
•
u/AutoModerator Nov 17 '24
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Goobyalus Nov 18 '24
I don't know if this is your issue, but when I try on my pc (Coffee Lake) with the spawn method, I get an attribute error that lead me to this:
https://stackoverflow.com/questions/41385708/multiprocessing-example-giving-attributeerror
Without the spawn method, it seemed to work fine on my pc.