lecture24 - Last time Introduction to Low-Level Programming...

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

View Full Document Right Arrow Icon
Introduction to Low-Level Programming Concepts CMSC 212 ecture 24 1 CMSC 212 Lecture 24 November 19, 2009 Last time c Libraries – an example of a program dynamically loading a shared library c Program optimization – issues involved in improving code performance ompiler optimization 2 CMSC 212 – compiler optimization c Process control – basic concepts about processes Reading c Read Sections 11.1-11.3 and 11.7, Bryant & O'Hallaron 3 CMSC 212 Processes, system calls, and rocess control, on't 4 CMSC 212 process control, con't.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Components of a process c Memory segments – program code (often called the text segment) – data (global variables and the heap) – the runtime stack c Processor registers e program counter, which indicates the next instruction to 5 CMSC 212 – the program counter, which indicates the next instruction to execute – general-purpose CPU registers – a processor status word, containing things like results of comparison operations – floating-point registers Process control block c In combined operating system and hardware, a PCB contains information about a process: – its state (new, ready, etc.) – CPU registers – memory management information – CPU scheduling information ccounting information 6 CMSC 212 – accounting information – I/O status information Storing PCBs c The system needs to keep track of the different processes that exist at any point in time c A collection of PCBs is called a process table c There are different ways to store PCB’s. One option: 1 2 3 4 5 6 7 CMSC 212 c Problems with this option: – it's hard to find processes – how is a process fairly selected when choosing one to run? P1 P2 P3 P4 P5 P6 Ready Waiting Waiting Ready New Terminated Queues of processes c Store processes in queues based on their state P1 P2 ready queue 8 CMSC 212 P3 P4 disk queue P5 P6 network queue
Background image of page 2
Creating a new process c The operating system creates a PCB for the new process – copy most entries from its parent – clear the accounting fields – allocate a PID (process id) for it llocates memory for it 9 CMSC 212 c Allocates memory for it – this could require copying all of the parent's segments, however the text segment usually doesn’t change, so that could be shared – using memory mapping hardware might help c Then adds its PCB to the ready queue System calls c System calls – provide the interface between application programs and the kernel – permit application programs to access protected resources – are called indirectly in UINIX via system call numbers
Background image of page 3

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

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

This note was uploaded on 11/23/2009 for the course CMSC 212 taught by Professor Staff during the Spring '08 term at Maryland.

Page1 / 6

lecture24 - Last time Introduction to Low-Level Programming...

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

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