240 likes | 271 Views
Explore the impact of interrupt latency and shared data issues in real-time operating systems (RTOS), including the use of semaphores for synchronization. Learn about managing critical sections effectively to prevent deadlocks and ensure reentrant functions. Discover best practices for optimizing interrupt handling and task scheduling in RTOS architectures.
E N D
Semaphores -Gajendra Singh
Interrupt Latency • The longest period of time during which that interrupt is disabled • Task code1 :disable interrupt for 125uS. • Task code2 :disable interrupt for 250uS. • Task code3 :critical & need to respond within 625us. • Interprocessor interrupt routine takes 300uS to execute.
Points to be noted • Lets cut the cost and replace uP that runs half as fast. • Similarly adding an extra task might also be awful. • Conclusion: Disabling Interrupts “Not a very good idea.”
Architectures • Round Robin • Round Robin with Interrupts • Function Queue Scheduling • RTOS
ISR_A; ISR_B; : : ISR_Z main(){ while(1){ if(A){ // do something} if(B){// do something} : : if(Z){// do something} } }
Reentrancy • Reentrant Functions: can be called by more than one task and still work correctly even if RTOS switches from one task to another in middle of executing one function.
For 8051 For INTEL 80x86
Advantages • Multiple Semaphores. • As signaling Device