Department of computer science and engineering                        2010-04-20
Chalmers                                                                                    Unix internals
ST/AD

Laboratory Assignment 2 - Processes

Purpose

Assignment:

  1. What commands are available to get process related information?
  2. List all processes in the system. Explain (as far as you can) the purpose of the system related processes.
  3. What information can you get about a process? What command gives the most important (most often needed) information?
  4. Investigate the scheduling (using the programs above) by writing a small cpu intensive program (wihout I/O) that you can run. What priority and what percentage of cpu usage do the process get? The scheduler in Linux is implemented in a different way than the one in FreeBSD, but this should not affect this assignment very much.
  5. What happens if you run several processes (with the same program) at the same time? How is the cpu percentage distributed?
  6. How is the priority affected by the nice value? Can you with two processes and the nice command get one to use 60-80%  of the CPU-time and the other the rest?
  7. The purpose with this and the following assignments is to investigate process group, session and parent (ppid) for commands. Execute the command 'cat | sort'. Execute the command 'ps -fj -u login_name' in another window. Which session, process group and parent do the processes cat and sort have? What other process belongs to the same session?
  8. Execute the command xterm&. Which new processes have started and to which session and process group do they belong?
  9. Execute the command xclock&. Which new processes have started and to which session, process group and parent do they belong? Which controlling terminal do they have? Terminate the window  in which xclock was started. Have parent process and controlling terminal changed for any of the processes?
(The processes in exercises 4, 5 and 6 may only be run on your own computer (not via ssh) to avoid disturbing other users of the computer. Also take care to terminate all processes when you are finished)

Reporting: