Describe the difference between multithreading and multiprocessing in the context of CPU-bound vs. I/O-bound tasks.