![Page 1: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/1.jpg)
Lecture 17: Operating Systems Intro to IT
COSC1078 Introduction to Information Technology
Lecture 17
Memory and DeadlockJames Harland
![Page 2: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/2.jpg)
Lecture 17: Memory & Deadlock Intro to IT
Introduction
James Harland• Email: [email protected]• URL: www.cs.rmit.edu.au/~jah• Phone: 9925 2045• Office: 14.10.1 • Consultation: Mon 4.30-5.30, • Thu 11.30-12.30What colour is my office
door? Carpet? Chair?
![Page 3: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/3.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Introduction to IT1 Introduction 2 Images3 Audio4 Video WebLearnTest 1 5 Binary Representation Assignment 16 Data Storage7 Machine Processing8 Operating Systems WebLearn Test 29 Processes Assignment 210 Internet11 Internet Security WebLearn Test 312 Future of IT Assignment 3, Peer and Self Assessment
![Page 4: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/4.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Overview Questions?
Assignments 2 & 3
Peer and Self Assessment
Memory and Deadlock
Questions?
![Page 5: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/5.jpg)
Lecture 17: Review Intro to IT
Assignments 2&3
Assignment 2: Due this week ()No single`right’ answerMain issue is to justify options to Granny
Assignment 3: start thinking about research topic
![Page 6: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/6.jpg)
Lecture 17: Memory and Deadlock SE Fundamentals
Tutorials Held each week Classes of up to 24 Tutor will answer questions related to materials Good place for individual feedback Peer and self assessment Peer learning groups (5 or 6) Assessed on process, not product Assessed in last tutorial Trial assessments in weeks 4 and 8
![Page 7: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/7.jpg)
Lecture 17: Memory and Deadlock SE Fundamentals
Self and Peer Assessment How well has each person contributed to the
group? Evaluated over the entire semester Assessed on process, not product Work out a grade for each person (CR, DI etc) Then convert this to a mark out of 20 Submit list of marks to tutor with justifications Repeat previous step until the tutor is satisfied See guidelines in Blackboard material
![Page 8: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/8.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Processes Executing in Context
Program Counter
InstructionRegister
CC ROMRAM
Processor Memory Disk00
BBCC
![Page 9: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/9.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Processes Executing in Context
Program Counter
InstructionRegister
BB ROMRAM
Processor Memory Disk00
BB
![Page 10: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/10.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Processes Executing in Context
Program Counter
InstructionRegister
FF ROMRAM
Processor Memory Disk00
FF
![Page 11: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/11.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Processes Executing in Context
Program Counter
InstructionRegister
BB ROMRAM
Processor Memory Disk00
BB
![Page 12: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/12.jpg)
Lecture 17: Memory and Deadlock Intro to IT
``Thomas, you wouldn’t! Naughty!’’
Program Counter
InstructionRegister
BB ROMRAM
Processor Memory Disk00
BB
![Page 13: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/13.jpg)
Lecture 17: Memory and Deadlock Intro to IT
``Thomas, you wouldn’t! Naughty!’’
Program Counter
InstructionRegister
BB ROMRAM
Processor Memory Disk00
BB
![Page 14: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/14.jpg)
Lecture 17: Memory and Deadlock Intro to IT
``Thomas, you wouldn’t! Naughty!’’
Program Counter
InstructionRegister
BB ROMRAM
Processor Memory Disk00
BB
![Page 15: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/15.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Software `Programs should be able to do anything!’ (???)
Programs should be able to do anything reasonable
What is reasonable?
Not changing OS, not deleting other processes from memory, not playing with other people’s things, …
![Page 16: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/16.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Memory Management
Memory Disk
Mine!
Mine!
Mine!
STOP IT!
![Page 17: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/17.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Memory Management
Memory DiskHMM ...
sandbox
![Page 18: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/18.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Virtual Memory
What if memory requirements exceed memory size?
Pretend we have more!
Shuffle required parts (pages) between disk and memory
Not every memory cell is needed all the time…
![Page 19: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/19.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Virtual MemoryVirtual Memory
DiskPhysical MemoryP
rocesssor
![Page 20: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/20.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Co-ordination and locking
MINE!
MINE!
MINE!
Works fine for one resource …
![Page 21: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/21.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Deadlock
Deadlock: neither can get both resources
BORING!
![Page 22: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/22.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Deadlock requirements
Deadlock requires:
1. Competition for nonshareable resources2. Processes request multiple resources
sequentially3. Resources cannot be forcibly retrieved
Avoid deadlock by preventing 1 or 2Detect and correct deadlock by falsifying 3
![Page 23: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/23.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Deadlock avoidance
Spooling makes nonshareable resources look like shareable ones …
![Page 24: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/24.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Operating Systems
Highly complex software systems
30-40 million lines of code
Lots of processes associated with them
Probably most sophisticated software ever written
Not many of them around …
![Page 25: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/25.jpg)
Lecture 17: Memory and Deadlock Intro to IT
Operating Systems
![Page 26: COSC1078 Introduction to Information Technology Lecture 17 Memory and Deadlock](https://reader036.vdocuments.us/reader036/viewer/2022062520/56815eb3550346895dcd3a3f/html5/thumbnails/26.jpg)
Lecture 16: Processes Intro to IT
Conclusion
Work on Assignment 2 (and 3?)
Research Topic for Assignment 3
Finish reading book!