Department of computer science and engineering
2010-04-20
Chalmers
Unix internals
ST/AD
Laboratory Assignment 2 - Processes
Purpose
To investigate and get some hands-on experience with Unix processes,
scheduling and process groups.
Assignment:
- What commands are available to get process related information?
- List all processes in the system. Explain (as far as you can) the
purpose of the system related processes.
- What information can you get about a process? What command gives
the most important (most often needed) information?
- 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.
- What happens if you run several processes (with the same program)
at the same time? How is the cpu percentage distributed?
- 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?
- 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?
- Execute the command xterm&. Which new processes have started
and to which session and process group do they belong?
- 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:
Written documentation of your results. Exercises 4-6 should be
demonstrated for a course assistant.