Operating Systems foe ES (Schedulers) Flashcards
High level schedule?
Scheduler allows tasks to be called (periodically or sporadically)
Low-level Schedule?
Scheduler can be viewed as a single timer interrupt service routine that is shared between many different tasks
Preemptive, non-preemptive?
preemptive - tasks can be interrupted
non-preemptive - tasks always run to completion
typecast the pointer: ‘void *aNumber’ to an integer pointer ‘intPtr’
int *intPtr = (int *)aNumber
What is difference between:
- (*intPtr)++; and
- intPtr++;
referencing and dereferencing.
- increments the integer saved in *intPtr
- increments the intPtr address to next entry
Round Robin limitations?
- tasks run in fixed order (no skipping/priorities)
- no control over timing
What is an Event-driven loop?
- tasks executed upon events
- tasks implemented as ISRs
- infinite while loop which gets interrupted
number of tasks in a tasklist tasks[]? Code?
numTasks = sizeof(tasks)/sizeof(tasks[0])
Difference between cooperative and preemptive scheduler?
Cooperative: tasks decide themselves when to halt and yield to another task
Preemptive: Scheduler decides when to halt current task and resume other task
What does context switch mean?
Changing of running task is called context switch
What are the manual steps of context switch?
- context pushed on stack: PC pushed by ISR automatically and r0 to r31, SREG and stack pointer are pushed manually
- restoring context from stack pointer of current TCB (task control block)
Define Concurrent Task Model
Describes functionality of system in terms of concurrently executing subtasks disregarding interleaving aspects
How to achieve communication between tasks?
- shared memory
- message passing
What is mutual exclusion and how is it achieved?
- when tasks enters critical sections all other tasks must be locked out until it leaves critical section
- Mutex and Semaphores