Explain how you would implement a producer-consumer system in Python. Would you use threading or multiprocessing and why?
Sigiloso
Use queue.Queue with threads for I/O-bound tasks or lightweight jobs. Use multiprocessing.Queue with processes for CPU-bound work. Threads share memory easily, while processes avoid GIL limitations.