Next: Looking at Processes
Up: Ceng 425 System Programming
Previous: Examples&Exercises:
Contents
A running instance of a program is called a process.
- When you invoke a command from a shell, the corresponding program is executed in a new process; the shell process resumes when that process completes.
- Use multiple cooperating processes in a single application to enable the application to do more than one thing at once, to increase application robustness, and to make use of already-existing programs.
- There are basically two operations to create or alter a
process.
- you can fork to create another process that is an exact copy of the existing process,
- you can use execve to replace the program running in a process with another program.
- Running another program usually involves both operations, possibly altering the environment in between.
- Newer, lightweight processes (threads) provide separate threads of execution and stacks but shared data segments.
- The Linux specific clone call was created to support
threads; it allows more flexibility by specifying which attributes are shared.
- The use of shared memory allows additional control over
resource sharing between processes.
Subsections
Next: Looking at Processes
Up: Ceng 425 System Programming
Previous: Examples&Exercises:
Contents
Cem Ozdogan
2007-05-16