Virtual memory, parallel programming Jakub Yaghob

Slides:



Advertisements
Similar presentations
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Advertisements

CSI 3120, Implementing subprograms, page 1 Implementing subprograms The environment in block-structured languages The structure of the activation stack.
Multiprocessing Memory Management
Run-Time Storage Organization
Operating Systems Lecture # 3. Recap Hardware Operating System Application System Call Trap Hardware Trap Processor.
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Week 7 February 17, 2004 Adrienne Noble. Important Dates Due Monday, Feb 23 Homework 7 Due Wednesday, Feb 25 Project 3 Due Friday, Feb 27 Homework 8.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
COS 598: Advanced Operating System. Operating System Review What are the two purposes of an OS? What are the two modes of execution? Why do we have two.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Paging Example What is the data corresponding to the logical address below:
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
Security Architecture and Design Chapter 4 Part 1 Pages 297 to 319.
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
Operating Systems Lesson 5. Plan Memory Management ◦ Memory segments types ◦ Processes & Memory ◦ Virtual Memory ◦ Virtual Memory Management ◦ Swap File.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Threads-Process Interaction. CONTENTS  Threads  Process interaction.
Lecture 20 Threads Richard Gesick. Threads Makes use of multiple processors/cores if available Share memory within the program (as opposed to processes.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
CS533 Concepts of Operating Systems Jonathan Walpole.
Memory Management. 2 How to create a process? On Unix systems, executable read by loader Compiler: generates one object file per source file Linker: combines.
CS 140 Lecture Notes: Virtual MemorySlide 1 Load-Time Relocation Process 1 0 ∞ Process 3 Operating System Process 6.
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership - process includes a virtual address space to hold the process image Scheduling/execution-
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
Embedded Real-Time Systems
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Chapter Overview General Concepts IA-32 Processor Architecture
CS161 – Design and Architecture of Computer
Run-time support Jakub Yaghob
CS 140 Lecture Notes: Virtual Memory
Processes and threads.
Process concept.
ECE232: Hardware Organization and Design
Process Management Process Concept Why only the global variables?
CS161 – Design and Architecture of Computer
Boots Cassel Villanova University
Memory Hierarchy Virtual Memory, Address Translation
COP 4600 Operating Systems Fall 2010
CS 140 Lecture Notes: Virtual Memory
Threads, SMP, and Microkernels
Segmentation Lecture November 2018.
Computer Organization & Compilation Process
Chapter 15, Exploring the Digital Domain
More examples How many processes does this piece of code create?
The Operating System Machine Level
CS 140 Lecture Notes: Virtual Memory
Operating Systems.
PROCESS MANAGEMENT Information maintained by OS for process management
Lecture 3: Main Memory.
Lecture 4- Threads, SMP, and Microkernels
Threads Chapter 4.
CS510 Operating System Foundations
MULTITHREADING PROGRAMMING
Lecture 35 Syed Mansoor Sarwar
Process.
CS703 - Advanced Operating Systems
Chapter 2 Operating System Overview
Computer Organization & Compilation Process
Assembly Language for Intel-Based Computers, 5th Edition
CS 140 Lecture Notes: Virtual Memory
COMP755 Advanced Operating Systems
4.3 Virtual Memory.
Run-time environments
CS Introduction to Operating Systems
Presentation transcript:

Virtual memory, parallel programming Jakub Yaghob Computer skills Virtual memory, parallel programming Jakub Yaghob

Process Process Program executed by OS Code, data, current activity Private address space

Physical Address Space Virtual memory Process security Work with more memory than available Virtual Address Space Physical Address Space Address Translation

Virtual memory – paging VAS/PAS divided to the blocks of the same size – pages/frames Translation converts a page number to a frame number Translation may not exist – page miss Present bit Page tables One level Multiple levels Zero level

Virtual memory – paging Virtual address 31 12 11 Page number (PN) Offset Page table [0] flags Physical address [1] 31 12 11 GLUE Frame number (FN) Offset [PN-1] [PN] FN [PN+1] [MAXPN]

Multitasking, multiprocessing Multiple processes running simultaneously on OS Multiprocessing Multiple CPUs in one computer

Thread Thread Multiple activities in one process Starting thread Private stack for each thread Local variables, parameters, chain of function calls Context

Memory organization Code Constants Initialized static data Uninitialized static data Heap Stack for thread n Stack for thread 1

Race condition Race condition The output is dependent on sequence or timing of other uncontrollable events Preemptive scheduling type PRec = ^TRec; TRec = record val:integer; next:Prec; end; var list:PRec; C next D nil list

Race condition Initial state Correct state Incorrect state Thread 1 InsertList(Ap); procedure InsertList(node:PRec); begin node^.next:=list; list:=node; end; Thread InsertList(Bp); Initial state list X Y Correct state Incorrect state A list B A X Y list X Y Another correct state B list A B X Y