Hacker News new | ask | show | jobs
by viccis 82 days ago
Wasn't my first, but my first unintentional one was writing multiprocessing code with Python on Windows many years ago. Not sure if this is still true now, but if you didn't wrap your main entrypoint in a if __name__ == "__main__" block, and your code spun up a worker pool, Python would reload your module for every child since Windows doesn't have a fork() for it to use, and they'd all happily rerun the code to create children, and so on.