RealtimeSchedulingSept19

RealtimeSchedulingSept19 - RealtimeSystemFundamentals:...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
10/27/11 Page 1 Realtime System Fundamentals :  Scheduling B. Ramamurthy
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10/27/11 Page 2 Realtime scheduling We discussed realtime system scheduling: Earliest deadline scheduling (EDS) Starting deadline  Completion deadline Dynamic priority scheduling  Rate monotonic scheduling (RMS)  Periodic tasks are prioritized by the frequency of repetition (high  priority to tasks with shorter periods) Preemptive scheduling Fixed priority scheduling Schedulability according to RMS  Σ (C i /T i ) <= n(2 1/n -1) Cyclic executives (pre-scheduled) (later: next class?) Concepts of cycle, slot and frame  Repeated execution times
Background image of page 2
10/27/11 Page 3 Task State Diagram Ready Blocked New Run Task admitted Resources allocated D i s p a t c h e d ;   u l o Waiting for event E v n r T k x it
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Resources  Shared resources: need mutual  exclusion Tasks cooperating to complete a job Tasks contending to access a resource Tasks synchronizing  Critical resources and critical region A important synchronization and mutual  exclusion primitive / resource is  “semaphore” 10/27/11 Page 4
Background image of page 4
10/27/11 Page 5 Critical sections and Semaphores When multiples tasks are executing there  may be sections where only one task could  execute at a given time: critical region or  critical section There may be resources which can be  accessed only be one of the processes:  critical resource Semaphores can be used to ensure mutual  exclusion to critical sections and critical  resources
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
10/27/11 Page 6 Semaphores See semaphore.h of xinu
Background image of page 6
Semaphores in exinu #include <kernel.h> #include <queue.h>     /**< queue.h must define # of sem queues  */ /* Semaphore state definitions */ #define SFREE 0x01     /**< this semaphore is free               */ #define SUSED 0x02     /**< this semaphore is used               */ /* type definition of "semaphore" */ typedef ulong semaphore; /* Semaphore table entry */ struct sentry {         char  state;       /**< the state SFREE or SUSED             */         short count;       /**< count for this semaphore             */         queue queue;       /**< requires q.h.                        */ }; 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Semaphores in exinu (contd.) extern struct sentry semtab[]; /**  * isbadsem - check validity of reqested semaphore id and state  * @param s id number to test; NSEM is declared to be 100 in kernel.h
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/27/2011 for the course CSE 321 at SUNY Buffalo.

Page1 / 23

RealtimeSchedulingSept19 - RealtimeSystemFundamentals:...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online