Best Effort Systems
-
The role of operating systems
-
- To abstract devices, resources and services into uniform and simple
interfaces.
- To manage shared access to devices, resources and services (all
referred to as resources).
-
Principles of best-effort systems
-
- Availability
- Utilization
- Fairness
- Graceful degradation
- Generality/Unspecialized
- Speed
- Simplicity
- Examples
-
- Unix
- Windows
- MacOS
- Essentially all desktop systems
- Resources
-
- CPU
- Memory
- Files
- Network
- The kernel
- System services
- Devices
Each of these has to be managed according to the best-effort principles.
- CPU Scheduling
-
- FCFS - Simple, fair (in some sense)
- SJN - Optimal (in some sense)
- Round Robin
- Multi-level feedback queues
- Priority queues
- Preemptive priority-based scheduling
- Other?
- Memory
-
- Essentially FCFS
- Can preallocate (done in the kernel)
- Virtual memory means that there is always enough memory - you
effectively never run out.
- However, the more virtual memory in use, the slower everything runs
- This is a perfect example of best effort graceful degradation and
fault tolerance.
- Other schemes?
- Files
-
- 2 issues: Allocation of space on disk and scheduling of requests
-
- Allocation
-
- assumed to be more or less infinite
- FCFS
-
- Scheduling (a system service)
-
- FCFS, optimized for efficiency, fairness, availability
- Synchronous in most systems i.e., applications block while waiting
- Can be asynchronous (high performance/parallel systems)
- Network
-
- Synchronous
- FCFS
- Nondeterministic service times (dependent on other processes/computers)
- The kernel
-
- In monolithic kernels, one application at a time can be in kernel
mode (i.e. servicing a system call)
- All other applications wait
- Time-sharing context switches do not occur until application has
left kernel mode
- In true microkernels (e.g., Mach) multiple applications can be in
"kernel mode" simultaneously.
- Other system services
-
- Accesses to system services (key server, ...) must also be scheduled.
- Usually FCFS
- Other Devices
-
- Access to other devices is also scheduled.
- Depends on device type
- Resources come on two flavors
-
- Consumable
- Serially reusable
- This affects the options for scheduling
- Consumable
-
- Once it is allocated it cannot be used by any other process
- If it isn't used at the time at which it is available, it is wasted
- Examples: CPU cycles, network packets, disk requests (sort of)
- Serially reusable
-
- After it is used by one process, it can be used by another process
- If it isn't used now, it can be used later
- Examples: Memory, disk space, ...
- Granularity of the resource is also an issue
-
- CPU cycles - allocated in blocks of thousands
- Memory - allocated in words (multiple bytes)
- Disk - allocated in blocks (hundreds of bytes)
- Network - allocated in packets (tens to thousands of bytes)
- Other resources - usually 1 request at a time
- Applications
-
- Usually non-critical
- Examples
-
- Word processing
- Software development
- Spreadsheets
- ...