1 / 13

Workbook 9: Managing Processes

Workbook 9: Managing Processes. Chapter 1: An introduction to processes. A process is a program in execution. Defined by a process control block, which includes: Process ID Process priority Process state Location of program in memory Address of next instruction to be executed

gavril
Download Presentation

Workbook 9: Managing Processes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Workbook 9: Managing Processes

  2. Chapter 1: An introduction to processes • A process is a program in execution. • Defined by a process control block, which includes: • Process ID • Process priority • Process state • Location of program in memory • Address of next instruction to be executed • List of resources held by the process • Etc, etc, etc

  3. Chapter 2: Process States in Linux • Creating a process: • The parent process duplicates itself (forking) • The child process runs a new program (execing) • Typically, the parent process waits for the child to die, as when executing a command in bash, though there are exceptions.

  4. Chapter 2: Process States in Linux (cont) • Processes can be in one of five states: • R: Runnable • S: Voluntary Sleep • D: Involuntary Sleep • T: Stopped (Suspended) Processes • Z: Zombie

  5. Chapter 3: Process scheduling in Linux • Every process has a numerical priority associated with it. • The lower the number, the higher the priority. • This priority can be adjusted up or down with the nice command. • All running processes get a chance to go during a scheduling “epoch”; higher priority processes get more time. • At the end of the epoch, processes are re-evaluated.

  6. Chapter 4: Sending signals • Signals can be sent to a process, for various reasons: • Hardware error, e.g. divide by zero • Software conditions, e.g. child dies or window resized • Terminal interrupts (CTRL-C and CTRL-Z) • Processes can send signals to other processes for various reasons, if owned by same user

  7. Chapter 4: Sending signals (cont)

  8. Chapter 5: Job control • Jobs can be run in foreground (can’t do anything else) or background (can do other other things). • From command line, finishing with “&” runs the command in the background. • Foreground jobs can be interrupted with CTRL-Z, then resumed with fg or run in the background with bg. • A list of running jobs can be generated with the jobs command.

  9. Chapter 6: Scheduling Delayed Tasks • Programs can be scheduled to run with the at command. • A list of scheduled commands can be viewed with the atq command.

  10. Chapter 7: Scheduling Periodic Tasks • The cron command can be used to schedule tasks to run at a specific time and day of the week or month. • cron tasks are defined in the cron table. • The cron table is edited with the crontab command.

  11. Conclusion • Like other computer systems, Linux provides facilities for managing processes. These are text-based, as per usual. • Processes can be in a number of different states, depending on what's happening.

  12. Conclusion (cont) • Processes are scheduled according to priority, and a process's priority can be set or changed with nice and renice. • Processes can be in a number of different states, depending on what's happening.

  13. Conclusion (cont) • Processes can communicate with each other via signals. • A number of jobs can be run at a time from the command line, if they are put in the background. • Processes can be run at set times with at and crontab.

More Related