211 - Operating Systems Flashcards
What are the functions of a operating system?
- It is an interface between User and Hardware
- Allocates resources to each user to ensure everyone has a fair share
- Managed the memory and security etc
What is the purpose of an OS
- Convenience
- Efficiency
Processes have 1 or more thread….
Small sequences of instructions managed independently by schedular
Benefit of threads
Fast and efficient
What is concurrency?
The act of managing and running multiple computations at the same time
What happens if a thread goes first and another one goes last?
It should have the same outcome
An interface in Java and how to implement it
Runnable and must have “public void run() as it’s method signature to implement it
What are the 3 central concepts in concurrent programming?
- Processor (ingredients)
- Program (recipe)
- Process (food you make)
Which is correct?
A program can have multiple processes
Or
A process can have multiple programs
A program can have multiple processes such as clicking on google chrome 10 times and getting 10 different windows
What is context switching?
Swapping from one process to the other quickly
Which is correct?
Processes are always parallel but not always concurrent
Or
Processes are always concurrent but not always parallel
Processes are always concurrent but not always parallel
What is parallelism?
The act of running multiple computations simultaneously
Weakness of a schedular
It is always adversarial so you expect it to do the worst possible thing
Benefits of multiprocessor systems
- Increased throughput
- Economy of scale
- Increased reliability
When is concurrency safe to do?
When not sharing data and when handling read only data