Podcast
Questions and Answers
What is the primary function of the operating system regarding processes?
What is the primary function of the operating system regarding processes?
- To manage and control process execution. (correct)
- To browse the internet.
- To create documents.
- To execute a single program.
Which data structure is used by the Operating System to manage processes?
Which data structure is used by the Operating System to manage processes?
- File Table
- Process Table also known as Process Control Block (PKB) (correct)
- Memory Map
- I/O Table
What kind of information is stored within a Process Control Block (PKB)?
What kind of information is stored within a Process Control Block (PKB)?
- List of installed software.
- Memory segments, process state, program registers, and open files. (correct)
- Only open files and network connections.
- Only PID and PPID.
What does the 'Program Status Word' (PSW) contain?
What does the 'Program Status Word' (PSW) contain?
What is the key difference between a process and a thread?
What is the key difference between a process and a thread?
What role does the 'scheduler' play in process management?
What role does the 'scheduler' play in process management?
What role does the 'dispatcher' play in process management?
What role does the 'dispatcher' play in process management?
Which event triggers a 'context switch'?
Which event triggers a 'context switch'?
What is the correct sequence of actions for process creation using the fork()
system call?
What is the correct sequence of actions for process creation using the fork()
system call?
After a fork()
call, What return value can the child process expect?
After a fork()
call, What return value can the child process expect?
What is the primary purpose of the exec()
system call?
What is the primary purpose of the exec()
system call?
If a parent process terminates before its child process, what happens to the child process?
If a parent process terminates before its child process, what happens to the child process?
What is a "zombie" process?
What is a "zombie" process?
Which problem does multithreading aim to solve?
Which problem does multithreading aim to solve?
Which variable/resource do threads in the same process share?
Which variable/resource do threads in the same process share?
In multithreading, what is a 'race condition'?
In multithreading, what is a 'race condition'?
What is the purpose of mutex locks in multithreading?
What is the purpose of mutex locks in multithreading?
How can process or thread parallelism be achieved?
How can process or thread parallelism be achieved?
In the context of concurrency, what does 'mutual exclusion' ensure?
In the context of concurrency, what does 'mutual exclusion' ensure?
What is the purpose of Inter-Process Communication (IPC)?
What is the purpose of Inter-Process Communication (IPC)?
What is a 'critical section' in concurrent programming?
What is a 'critical section' in concurrent programming?
What are the four conditions that a solution must fulfill to be considered a correct solution to the critical section problem?
What are the four conditions that a solution must fulfill to be considered a correct solution to the critical section problem?
What is the main idea behind disabling interrupts as a method of providing mutual exclusion?
What is the main idea behind disabling interrupts as a method of providing mutual exclusion?
What is a disadvantage of lock variables?
What is a disadvantage of lock variables?
What is a key feature of the 'Test and Set Lock' (TSL) instruction?
What is a key feature of the 'Test and Set Lock' (TSL) instruction?
What is the goal of implementing passive waiting?
What is the goal of implementing passive waiting?
What is the role of semaphores in process synchronization?
What is the role of semaphores in process synchronization?
Which of the following is a typical usage of Semaphores?
Which of the following is a typical usage of Semaphores?
What problems are guaranteed to never happen with a correct implementation of monitors?
What problems are guaranteed to never happen with a correct implementation of monitors?
What is a message queue used for?
What is a message queue used for?
What synchronization problem is illustrated by the Dining Philosophers problem?
What synchronization problem is illustrated by the Dining Philosophers problem?
What's the difference between named and unnamed Pipes?
What's the difference between named and unnamed Pipes?
How many syscalls are needed to create a Bi-Directional communication lane between two processes?
How many syscalls are needed to create a Bi-Directional communication lane between two processes?
What is the correct way of connecting the output of one command to another command as input in the shell?
What is the correct way of connecting the output of one command to another command as input in the shell?
What are signals used for?
What are signals used for?
Which is the correct abstraction for signaling a process from another process?
Which is the correct abstraction for signaling a process from another process?
What can be said about these two syscalls? kill()
and pause()
What can be said about these two syscalls? kill()
and pause()
How can a process specify a handler for a specific signal?
How can a process specify a handler for a specific signal?
Which of the following is MOST accurate about OS process scheduling?
Which of the following is MOST accurate about OS process scheduling?
What is the main goal of the scheduler?
What is the main goal of the scheduler?
What is a drawback of Round Robin scheduling?
What is a drawback of Round Robin scheduling?
A Round Robin scheduling has its time slice set. What happens if the quantum expires?
A Round Robin scheduling has its time slice set. What happens if the quantum expires?
Which can be said about processes scheduled with static priorities?
Which can be said about processes scheduled with static priorities?
Which algorithm will most likely avoid starvation given the appropriate setting?
Which algorithm will most likely avoid starvation given the appropriate setting?
What is the main challenge in real-time scheduling?
What is the main challenge in real-time scheduling?
Flashcards
What is a process?
What is a process?
A program in execution, managed by the OS
What is a Process Control Block?
What is a Process Control Block?
A data structure containing information about a process.
What does proccessor state refer to?
What does proccessor state refer to?
The current state of the process and processor.
What is proccess Identification?
What is proccess Identification?
Signup and view all the flashcards
What is Threads?
What is Threads?
Signup and view all the flashcards
What is the intention of Mutex?
What is the intention of Mutex?
Signup and view all the flashcards
What is the Race condition?
What is the Race condition?
Signup and view all the flashcards
What is Critical section?
What is Critical section?
Signup and view all the flashcards
What is mutual exclusion?
What is mutual exclusion?
Signup and view all the flashcards
active waiting
active waiting
Signup and view all the flashcards
What is interprocess communication?
What is interprocess communication?
Signup and view all the flashcards
passive waiting
passive waiting
Signup and view all the flashcards
What does Wait() method do?
What does Wait() method do?
Signup and view all the flashcards
What does Signal method do?
What does Signal method do?
Signup and view all the flashcards
How is Mutual exclusion implemented?
How is Mutual exclusion implemented?
Signup and view all the flashcards
What does deadlock means?
What does deadlock means?
Signup and view all the flashcards
Why are there Proccess schedulers?
Why are there Proccess schedulers?
Signup and view all the flashcards
How do Proccess schedulers function?
How do Proccess schedulers function?
Signup and view all the flashcards
How should an algorithm be?
How should an algorithm be?
Signup and view all the flashcards
What's the function of a Queue?
What's the function of a Queue?
Signup and view all the flashcards
Benefit of queues?
Benefit of queues?
Signup and view all the flashcards
Study Notes
- These are study notes on operating system processes as taught in the 2nd grade of Telecommunications Technology Engineering
Block 1: Operating Systems
- Explores key computer architecture concepts.
- Covers operating systems, processes, memory management, and file systems
Contents Covered
- Introduces operating systems, processes, and threads
- Communication and synchronization mechanisms
- Scheduling algorithms
- Memory and file management
Processes
- Programs in execution are considered processes; these are processing units managed by the operating system.
Topics in the Processes Section
- Process creation
- Process intercommunication
- Synchronization
- Scheduling
- Algorithm mechanism coverage
- Passive wait implementation.
Program vs Process
- A program represents a recipe, while a process represents that recipe in action.
- A process is a unit of processing managed by the OS
Process Table and PCB
- OS maintains a data structure that relies on Processes and Control Blocks
- Segments of the memory image include C+D+S.
- The state of the processor
- File descriptors already opened, PID, user id, and timers.
Process State and CPU
- When a process is running, its state resides in the CPU.
- It exists in the Processes Table's PCB when not running
PCB Information
- Includes identification details like PID, PPID, and user/group IDs.
- Processor State: This captures the process's state.
- This includes CPU registers like PSW, user/kernel mode, interrupt status, priority, and results.
- Includes PC and SP
- Control State
- Scheduling for ready and blocked processes
- Inter-process communications
- Signals for timing
- Information on CPU time, memory
Memory Table Management
- Controls what memory is allocated to the process
- Includes segment information
- CS: base address and code amount
- DS: data variables and static data
- SS: starting address
- Permissions
- Table for memory pages
- Dynamic Memory Pointer
- Information on shared memory being used.
I/O Table
- Allocates peripherals and I/O operations.
File Table
- It provides the position in the FILP.
- Info about the directories used
- Access permissions
Example PCB framework from MINIX 1.0
- Example
extern struct proc
- Process registers
int p_reg[NR_REGS];
- Stack pointer
int *p_sp;
- PC and PSW
struct pc_psw p_pcpsw;
- Memory Map
struct mem_map p_map[NR_SEGS];
- Process id
-
int p_pid;
- Process registers
Basic States of Process
- Execution
- Blocked
- Ready to be executed
Planner Responsibility
- The scheduler chooses the next process to run
- Idle loop for when all processes are idle
- Keeps CPU going
- Necessary, prevent errors
- Saves energy
- Calculate CPU usage
- Basic function for managing memory
Processes are Heirarchical
- Parents, Children, and siblings
- Follow processing life cycle
Life Cycle Includes
- Create
- Execute
- Shutdown
- Has a set of execution types
- Batch
- Interactive
Process Management
- PGID
- SID
Processes Inherit information
- Gets variable from creation
- Can use and change values that effect parent and siblings
- IZEN-BALIO table at execution start.
int main(int argc, char **argv, char **envp);
Process Setting
- Defaults to parents
- Set via shell command or via API
- Variables are PATH, TERM,HOME, PWD, USER
- Access via command
echo $aldagaia
and c codegetenv("aldagaia")
Multitasking
- Single-tasking does nothing while waiting for Input / output
- CPU Input / Output and parallelism
- Input / Output system depends on OS.
- Memory needed to save several states
- Used to increase performance
Multi-tasking Implementation
- Processes Input / Outputs are dependent on the OS, this lets the CPU access a new task
- Provides better performance
- Allows multiple interactive users
- Makes it easier to work on applications that should use multiple threads
Types of Computers
- Multiprogamming via time slicing illusion of concurrency
- Multi-Processor is true concurrency
- Multi-Computer works together (processing is distributed)
Concurrency Purpose
- More usage better of physical resources
- Modular processing increases work force
- Interaction is optimized
Types of Concurrent Processing
- Colleagues
- Independents
Kinds of Interaction
- Share processing power
- Communicate and sync, colleagues
How to handle paralellism and I/O
- I/O devices get interrupts
- An interrupt is addressed by the corresponding memory map.
- OS uses I/O controller for processes to resume from the ready queue
Context Switching
- Caused by interrupt
- Processes' state goes into the PCB
- Interrupt routine executes code
- Scheduler works
- Dispatcher initiates execution depending on the OS scheduler routine
Process Loading
- Executable binary loads into main memory image and the process executes
Process Creation
- Achieved via "fork"
- Clones a process including the code and information
- The child can be run and modified without disturbing the parent.
Execution Modification
- Can be achieved via "exec"
- Has two phases
- HUSTE removes current memory allocation
- KARGA builds the state of a process
- Has two phases
- Must keep PID, I/O
Process Timing
- Timing issues of process can be fixed
- A process must wait till the prior exits before starting.
A-Semen life Cycle
- Semeek is a copy and executes
- The atia takes up after the first is done.
- Can deadlock though
Threads
- Threads are known as light-weight processes
- All share an image, execute uniquely
- Each thread has its own
- PC
- Stack Pointer
- Errors
- Share files
Pros and Cons of Threads
- Share memory
- Shorten time in system
- Allow lockstep parallel
- Don't block system easily
- Easy to delegate tasks
- Needs synchornized Process sync required for intercommunication
Communication
- Communication occurs over calls are used for sending and receiving messages
- Signals, and files are mechanisms
- Sharing leads to conflicts.
Race conditions
- Race conditions need to be addressed for process integrity
- Processes can not simultaneously access critical resources
- Can be solved with flags
Active vs Passive Waiting
Active Waiting means waiting and polling which requires CPU resources Passive Waiting means waiting on the processes to complete.
Classic Issues
- Critical section
- Producer-consuer
- Irkacle-isles arazoa
- Bezero-zerbitzaria
Critical Section Review
- Needs to limit how many process can be in at any given time.
- There must be a mutual exit.
- Must finish in a timely manner
TSL and Sets
- These atomic commands for handling issues of critical process.
Classic IPC problems
- SE needs to do it
- They are called PUA and prevent processing overhead
Atomic Transactions
- Must be done for file or resource security
Production Consumption Review
- Consumers must wait on products.
- Produces must wait on consumers to consume.
Read-Write Review
- Readers consume multiple times while writing must be handled first.
Communication Mechanism
- Intercommunication requires calls and interfaces
- File system usage
Methods of Communication
- Files
- Hodiak (pipes, FIFOs)
- Partial image sharing
- Messages
Synchronized Communication
- Can be handled via messaging, signals
- Has several methods
- Code management
- Sempahores
File Sharing
- All processes share files
- The upside is simple processing
- The downside has high processing over head needs synchronization.
Pipes
- Used for temporary or simple code
- Managed by OS - First In First Out
Named vs unamed pipes
- Named are FIFO
- Unmaed are for child/parent only
Datastreams
- Requires 2 hodis
Pipeline Code Example
- Requires std io library for operation
Queue Review
- Code for queue is needed as prior steps can interfere.
Queue Review
- Uses the pipeline
Seinaleaks
- Interrupts that are done in short bursts handled.
- Kill for interrupt
Handling signals and interrupts
- Can halt signals via code or call another signal interrupt.
- Pause ()
- Kill (0 exits code
Handling Events
- Hardware, and Software trigger signals with code
- Signal - sends hardware instructions
- Hardware then sends signals to software
- Needs treatment for handling signals
- Called Pause
- Also can delay response
Process Scheduling
- Has several factors
- CPU
- IO
- Time
Goal of Process Scheduling
- Has a variety of goals.
- CPU usage time, and max throughput
Planning
-
Has a variety of types.
- Can be more IO, cpu, etc focused. Process scheduling
-
Can be done based on type
-
Has a variety of parameters and configuration.
- Has priority
- Static,
- dynamic
- Has priority
-
All types of plans have different priorities.
-
Lani laburmena
-
Can also be randomized
Planning types
- Can mix the different types of scheduling.
- Can also be intermixed for types and kinds of queues Has several methods to prevent deadlock
Time Monitoring
- Needed to limit certain calls.
Time Sharing
- Some processes wait, others do not, each is dependent on one another.
Shared Memory Planning
- Has several levels to maximize performance
Multicore Planning
- Uses all available cores for increased performance
Resource Assignment
- Each section of process is resource intensive to a different extent
Load Balancing
- All different tasks can go to queues
Batch Processing
- Resources assigned to load balance
Lehentasunak
- Different types to assign importance
Round Robin
- Evenly allocates resources Used in network sharing
- Equal Priority
Prioritized
- Has priority over others
- Can be static
- Can be dynamic
Loteria
- Random for fairness
- Uses lotto tickets depending on hardware
Process management
- Can be done
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.