Explain the difference between threading and multiprocessing in Python. When would you use each in a data processing pipeline?