Exercises

  1. Run the ps aux command in a Terminal window. Attempt to explain every process that you see listed.

  2. Is it possible for your computer to run out of processes? If you think the answer is no, explain why. If you think the answer is yes, devise an experiment to make your computer run out of processes, try it out, and explain what happens. Is there any way to recover from this situation other than rebooting your computer?

  3. Explain the difference between a process and a thread.

  4. Run the Quartz Debug program in the /Developer/Applications folder. Select “flash screen updates.” Explain how different kinds of programs (Carbon, Cocoa, Swing) use threads differently. Can you explain the different threads running in each of your applications?

  5. Type man vmstat in a Terminal window to review the documentation for the vmstat command. Explain what this program does, in your own words. Explain the output of the commands vmstat -i, vmstat -m, vmstat -s, and vmstat -z.

Get Building Cocoa Applications: A Step by Step Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.