Operating System
Operating System
Drawbacks:
- Less isolation compared to VMs
- OS dependency
- More complex networking
- Security concerns due to shared kernel
2. Indirect Costs:
- Cold cache misses
- Pipeline flushes
- Memory access delays
- Increased memory bus traffic
3. Performance Impact:
- Reduced effective CPU utilization
- Increased response time
- Higher energy consumption
- Decreased throughput
4. Mitigation Strategies:
- Optimize scheduling quantum
- Group related processes
- Minimize unnecessary switches
- Use processor affinity
2. Context Switching
- Preemptive: Frequent context switches possible
- Non-preemptive: Context switching only at process
termination or I/O
3. Response Time
- Preemptive: Better response time for high-priority tasks
- Non-preemptive: Can lead to poor response time for
urgent tasks
2. Payroll System:
- Use Non-preemptive scheduling because:
* Tasks are not time-critical
* Batch jobs need to complete in entirety
* Reduced overhead from context switching
Disadvantages:
1. Higher context switching overhead
2. Complex implementation
3. Shared resource synchronization issues
4. Potential race conditions
2. Scheduling Rules:
- Allow preemption for high-priority tasks
- Use time quantum for medium priority
- Let low-priority tasks complete uninterrupted
3. Implementation Features:
- Priority inheritance protocol
- Dynamic priority adjustment
- Resource monitoring system
- Starvation prevention mechanism
3. Implementation Considerations:
- Use priority boosting for foreground apps
- Implement intelligent background process
management
- Include power-aware scheduling decisions
- Maintain balance between responsiveness and
battery life
4. Trade-offs:
- Higher battery consumption vs better responsiveness
- More complex implementation vs better user
experience
- Increased memory usage vs improved multitasking
Topic 1: Scheduling Criteria
3. System Performance:
- Reduced scheduling overhead
- Better process management
- Improved system responsiveness
Topic 4: Threads
2. Implementation Features:
- Dynamic thread pool sizing
- Task queue for pending requests
- Synchronization mechanisms
- Resource sharing controls
3. Thread Types:
- Listener thread
- Worker threads
- Management thread
- Cleanup thread