15 Process Control

15 Process Control - !"#$"%% %...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: !"#$"%% % CMSC 216 Introduction to Computer Systems Lecture 15 Process Control Jan Plane & Pete Keleher {jplane,keleher}@cs.umd.edu Administrivia 3b due was due yesterday 6pm late period until tomorrow at 6pm Project 4 posted due April 10 There are a lot of functions implement and test those independently rather than writing the whole thing at one time and then testing!!! Read Sections 8.2-8.5, on process control 2 !"#$"%% # P ROCESS C ONTROL Sections 8.2-8.5, Bryant and O'Hallaron 3 Processes Definition: "an instance of a program in execution" A process provides a context for the executing program: current memory state, open files, register contents, PC, environment variables When you type in the name of a program in the shell, the shell creates a new process in which that program will run 4 !"#$"%% ! Multitasking Even though it appears to us that many programs run at the same time, in reality, only one process is able to use a CPU at a time The CPU is divided between all the currently running processes by the OS, which forces processes to be suspended To each process, it appears as if the process has sole control of the CPU, and logical flow of one process isn't affected by others (except for IPC) 5 Multitasking example 6 A B C D A C Time !"#$"%% ' User and kernel modes Some instructions are restricted (or privileged ), so that only the OS can execute them e.g., halting the CPU, performing I/O, creating processes When a process needs to do one of these things, the process must enter kernel mode Normally, processes are in user mode 7 User and kernel modes, cont. When in user mode, trying to perform a privileged instruction or access kernel- reserved memory results in a fatal protection fault Should a process need to do one of these things, it needs to use the system call interface to access these instructions/areas of memory 8 !"#$"%% ( Implementation of multitasking To move processes in and out of the CPU, the kernel needs to maintain the context (execution state) of each process Data structures used to maintain context: page table, stores processes' address spaces process table, stores information about each process file table, lists which files are opened by each process 9 Context switching When a process is to be moved out of the CPU, the context is saved and the context of the incoming process is restored This is how the kernel schedules processes in the CPU Processes can be switched out whenever the kernel deems it necessary or appropriate when a process is waiting for I/O when a process has been using the CPU for a long time 10 !"#$"%% ) System calls "The system call is the fundamental interface between an application and the Linux kernel." between an application and the Linux kernel....
View Full Document

Page1 / 15

15 Process Control - !"#$"%% %...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online