17.6. Exercises
17-1. Processes vs. Threads. What are the differences between processes and threads?
17-2. Threads. If multiple threads are running on a single CPU system, how do they share the CPU?
17-3. Threads. Do you think anything significant happens if you have multiple threads on a multiple CPU system? How do you think multiple threads run on these systems?
17-4. Threads and Files. Update your solution to Exercise 9-19 which obtains a byte value and a file name, displaying the number of times that byte appears in the file. Let's suppose this is a really big file. Multiple readers in a file is acceptable, so create multiple threads that count in different parts of the file so that each thread is responsible for a certain part of the file. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access