Download presentation
Presentation is loading. Please wait.
Published byAlbert Rudolf Faragó Modified over 5 years ago
1
Virtual memory, parallel programming Jakub Yaghob
Computer skills Virtual memory, parallel programming Jakub Yaghob
2
Process Process Program executed by OS Code, data, current activity
Private address space
3
Physical Address Space
Virtual memory Process security Work with more memory than available Virtual Address Space Physical Address Space Address Translation
4
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
5
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]
6
Multitasking, multiprocessing
Multiple processes running simultaneously on OS Multiprocessing Multiple CPUs in one computer
7
Thread Thread Multiple activities in one process Starting thread
Private stack for each thread Local variables, parameters, chain of function calls Context
8
Memory organization Code Constants Initialized static data
Uninitialized static data Heap Stack for thread n Stack for thread 1
9
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
10
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.