About this question
Medium · Code Analysis · Quant Trader interview question · python, multiprocessing, threading, GIL, concurrency, parallelism
You're developing a Python-based Monte Carlo simulation to price exotic options. The simulation is computationally intensive (CPU-bound). You initially implemented parallelization using Python's threading module, but observed no significant performance improvement compared to the single-threaded version. After switching to Python's multiprocessing module, you see a substantial speedup, closely aligning with the number of CPU cores available. Why did multiprocessing provide a performance boost wh