SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Priority Inversion
When a low-priority task blocks a higher-priority one, a priority
inversion is said to occur




Assume that priorities: p1>p2>p3, and tasks 1 and 3 share the same
critical resource


                                                                     1
Priority Inheritance Protocol
In the PIP the priorities of tasks are dynamically changed so that the
priority of any task in a critical section gets the priority of the highest
task pending on that same critical resource.




                                                                              2
Priority Inheritance Protocol




                                3
Priority Inheritance Protocol




                                4
Priority Ceiling Protocol
Each resource is assigned a priority ceiling equal to the priority of
the highest priority task that can use it




                                                                        5
Priority Ceiling Protocol




                            6
Priority Ceiling Protocol




                            7
ORIGINAL CEILING PRIORITY PROTOCOL (OCPP)
•Each process has a static default priority assigned (for example,
by deadline monotonic scheme: less deadline – greater priority, or
by rate monotonic scheme: less period – greater priority).
•Each resource has a static ceiling value defined, this is the
maximum priority of the processes that use it (assume that greater
priority is represented by greater value).
•A process has a dynamic priority which is the maximum of its own
static priority and any it inherits due to it blocking higher-priority
processes (when process blocks higher-priority task it gets
temporarily this higher priority).
•A process can only lock a resource if its dynamic priority is higher
than the ceiling of any currently locked resource (excluding any that
it has already locked).




                                                                         8
Original Ceiling Priority Protocol




D                   E   E   b   b   Q   V   E


C           E   b   P   P   b   b   P   P   P   V   V   E


B           P   b   P   P   b   b   P   P   P   P   P   P   E   E

A   E   Q   P   Q   P   P   Q   Q   P   P   P   P   P   P   P   P   E




                                                                        9
10
Memory Management
Stack management:




Ideally, provision of at least one more task than anticipated should be
allocated to the stack to allow for spurious interrupts and time
overloading
                                                                          11
Memory Management




                    12
Swapping
A process is saved to an external device when its time
expires. The next process is loaded instead

                      Overlays
Main(){
a(); b(); c()
}
This program can be represented as a root segment
always resident in memory, and three overlay segments
a, b, c
Memory required in this case is
max(mem_a,mem_b,mem_c)
instead of
mem_a+mem_b+mem_c
                                                         13
Partitions
Static partitions with absolute addresses
Number of partitions and the sizes are fixed. Tasks are
compiled for the particular partition. There may be a skew in
partitions loading
Static partitions with relative addresses
Number of partitions and the sizes are fixed. Tasks are
compiled for any partition, need adjustment.
Happens internal fragmentation
Dynamic partitions
Number of partitions vary, tasks get partition of the necessary
size. External fragmentation can occur => garbage collection
(de-fragmentation)




                                                                  14
De-fragmentation




                   15
Virtual Memory
Segmented: virtual address = (segment, offset)
Address=start(segment)+offset
Paged: (page, offset)
Address=start(page)+offset
Segmented-paged: (segment, page, offset)
Address=start(segment)+start(page)+offset

              Replacement algorithms
FIFO, LRU (Least recently used)
If we have 4 page memory and
2 4 6 8 is a a page reference string (page 2 is the least and
page 8 is the most recently used) then
2 4 6 8 9 2 4 6 8 9 2 4 6 8 9 will lead to page thrashing
Memory locking, Working sets
                                                                16
I/O Problems
    Disk fragmentation
    Contiguous file allocation: place parts of a file in adjacent
    sectors
    Elevator algorithm: reorder queries so that they will be served
    with minimal magnetic head replacement


                           Criteria for RTOS
1. Interrupt latency
2. Number of processes system can maintain
3. Memory for OS
4. Scheduling mechanisms set (round-robin, preemptive, etc)
5. Available communication methods (mutexes, semaphores, etc)
6. After sale support

                                                                      17
RTOS Criteria
7. Software development kits available
8. Hardware platforms support
9. Source code availability
10. Task context switch time
11. RTOS cost
12. Compatibility with other RTOS
13. Networks and network protocols supported by
    RTOS
A fitness metric can be
                          13
        M                
                          i  1
                                        i   m   i


                                                     18
19
20
POSIX (Portable Operating System Interface
for Computer Environments, IEEE Standard)
       http://www.unix.org/single_unix_specification/
1. Threads – each process can contain several threads
2. Mutexes and Condition variables -




It is essential to associate a mutex with a condition variable. A thread
locks the mutex for some shared data and then checks whether data
are in the proper state. If no, the thread waits on the appropriate
condition variable. Waiting on the condition variable automatically
unlocks the mutex. When some thread puts the data in the proper
state, it wake a waiting thread by signaling. One thread comes out of
its wait state with the mutex locked
                                                                           21
POSIX Semaphores
Binary and counting




                                  22
POSIX Messages




                 23
Real-Time POSIX Signals
Signals are software representation of interrupts or exception
occurrences. No routine should be called from a signal handler
that might cause the handler to block.
Signals are used for
•Exception handling
•Process notification of asynchronous event occurrence
•Process termination in an abnormal situation
•Interprocess communication




                                                                 24
Real-Time POSIX Signals




                          25
Real-Time POSIX Signals




                          26
System POSIX Signals




                       27
Clocks and Timers
Typically the system time is represented by a 32 bit unsigned integer,
while tick value (time resolution) is represented by a float-point value




  If k denotes system tick, and n is the value stored in sys_clock, then
  the actual time elapsed is kn




                                                                           28
POSIX Clocks
  POSIX allows many clocks to be used by an application. Each
  clock has its own identifier of type clockid_t. Commonly
  supported and used identifier is CLOCK_REALTIME that is
  systemwide clock visible for all processes.




Data structure timespec has two fields of the long integer type
representing the value in number of seconds since the Epoch
(tv_sec) and in nano-seconds (tv_nsec). Epoch started 00:00:00
1.1.1970
                                                                  29
POSIX Clocks




               30
POSIX Timers




               31
POSIX Timers




               32
POSIX Asynchronous Input/Output
AIO operations use AIO Control Block aiocb:




                                              33
POSIX Memory Locking




                       34

Más contenido relacionado

La actualidad más candente

Process Synchronization
Process SynchronizationProcess Synchronization
Process SynchronizationShipra Swati
 
CPU SCHEDULING AND DEADLOCK
CPU SCHEDULING AND	DEADLOCKCPU SCHEDULING AND	DEADLOCK
CPU SCHEDULING AND DEADLOCKVicky Kumar
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)Naren Chandra
 
IJCER (www.ijceronline.com) International Journal of computational Engineeri...
 IJCER (www.ijceronline.com) International Journal of computational Engineeri... IJCER (www.ijceronline.com) International Journal of computational Engineeri...
IJCER (www.ijceronline.com) International Journal of computational Engineeri...ijceronline
 
Contiki introduction II-from what to how
Contiki introduction II-from what to howContiki introduction II-from what to how
Contiki introduction II-from what to howDingxin Xu
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPTQUONTRASOLUTIONS
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in JavaMisha Kozik
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSFernando Luiz Cola
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptablesKernel TLV
 
The Silence of the Canaries
The Silence of the CanariesThe Silence of the Canaries
The Silence of the CanariesKernel TLV
 

La actualidad más candente (20)

Enhancing the region model of RTSJ
Enhancing the region model of RTSJEnhancing the region model of RTSJ
Enhancing the region model of RTSJ
 
Basanta jtr2009
Basanta jtr2009Basanta jtr2009
Basanta jtr2009
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
CPU SCHEDULING AND DEADLOCK
CPU SCHEDULING AND	DEADLOCKCPU SCHEDULING AND	DEADLOCK
CPU SCHEDULING AND DEADLOCK
 
Process scheduling linux
Process scheduling linuxProcess scheduling linux
Process scheduling linux
 
Ch17
Ch17Ch17
Ch17
 
FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)FreeRTOS basics (Real time Operating System)
FreeRTOS basics (Real time Operating System)
 
Unit iv: Deadlocks
Unit iv: DeadlocksUnit iv: Deadlocks
Unit iv: Deadlocks
 
IJCER (www.ijceronline.com) International Journal of computational Engineeri...
 IJCER (www.ijceronline.com) International Journal of computational Engineeri... IJCER (www.ijceronline.com) International Journal of computational Engineeri...
IJCER (www.ijceronline.com) International Journal of computational Engineeri...
 
Contiki introduction II-from what to how
Contiki introduction II-from what to howContiki introduction II-from what to how
Contiki introduction II-from what to how
 
Process and Threads in Linux - PPT
Process and Threads in Linux - PPTProcess and Threads in Linux - PPT
Process and Threads in Linux - PPT
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
The Silence of the Canaries
The Silence of the CanariesThe Silence of the Canaries
The Silence of the Canaries
 
Final Exam OS fall 2012-2013 with answers
Final Exam OS fall 2012-2013 with answersFinal Exam OS fall 2012-2013 with answers
Final Exam OS fall 2012-2013 with answers
 
CPU Scheduling
CPU SchedulingCPU Scheduling
CPU Scheduling
 
Tc basics
Tc basicsTc basics
Tc basics
 
Process
ProcessProcess
Process
 

Destacado

Survey Results Age Of Unbounded Data June 03 10
Survey Results Age Of Unbounded Data June 03 10Survey Results Age Of Unbounded Data June 03 10
Survey Results Age Of Unbounded Data June 03 10nhaque
 
Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual   Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual neeraj7svp
 
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)Anne Nicolas
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 

Destacado (6)

Survey Results Age Of Unbounded Data June 03 10
Survey Results Age Of Unbounded Data June 03 10Survey Results Age Of Unbounded Data June 03 10
Survey Results Age Of Unbounded Data June 03 10
 
Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual   Solution manual real time system bt jane w s liu solution manual
Solution manual real time system bt jane w s liu solution manual
 
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)
Kernel Recipes 2016 - Wo needs a real-time operating system (not you!)
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Rtos Concepts
Rtos ConceptsRtos Concepts
Rtos Concepts
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 

Similar a Ch3-2

Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating SystemsPawandeep Kaur
 
RTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffRTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffadugnanegero
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview QuestionsKuntal Bhowmick
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementationRajan Kumar
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012TEST Huddle
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic conceptMOUMITA GHOSH
 
Os solved question paper
Os solved question paperOs solved question paper
Os solved question paperAnkit Bhatnagar
 
Operating systems
Operating systemsOperating systems
Operating systemsanishgoel
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded SystemsHimanshu Ghetia
 
xCORE architecture flyer
xCORE architecture flyerxCORE architecture flyer
xCORE architecture flyerXMOS
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating SystemSharad Pandey
 
slides8 SharedMemory.ppt
slides8 SharedMemory.pptslides8 SharedMemory.ppt
slides8 SharedMemory.pptaminnezarat
 
Containerizing HPC and AI applications using E4S and Performance Monitor tool
Containerizing HPC and AI applications using E4S and Performance Monitor toolContainerizing HPC and AI applications using E4S and Performance Monitor tool
Containerizing HPC and AI applications using E4S and Performance Monitor toolGanesan Narayanasamy
 

Similar a Ch3-2 (20)

Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Real Time Operating Systems
Real Time Operating SystemsReal Time Operating Systems
Real Time Operating Systems
 
RTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffffRTOS Material hfffffffffffffffffffffffffffffffffffff
RTOS Material hfffffffffffffffffffffffffffffffffffff
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview Questions
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
Mike Bartley - Innovations for Testing Parallel Software - EuroSTAR 2012
 
Real time system basic concept
Real time system basic conceptReal time system basic concept
Real time system basic concept
 
Os solved question paper
Os solved question paperOs solved question paper
Os solved question paper
 
Operating System
Operating SystemOperating System
Operating System
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
Real Time OS For Embedded Systems
Real Time OS For Embedded SystemsReal Time OS For Embedded Systems
Real Time OS For Embedded Systems
 
xCORE architecture flyer
xCORE architecture flyerxCORE architecture flyer
xCORE architecture flyer
 
Real Time Operating System
Real Time Operating SystemReal Time Operating System
Real Time Operating System
 
Lab6 rtos
Lab6 rtosLab6 rtos
Lab6 rtos
 
Mastering Real-time Linux
Mastering Real-time LinuxMastering Real-time Linux
Mastering Real-time Linux
 
slides8 SharedMemory.ppt
slides8 SharedMemory.pptslides8 SharedMemory.ppt
slides8 SharedMemory.ppt
 
Containerizing HPC and AI applications using E4S and Performance Monitor tool
Containerizing HPC and AI applications using E4S and Performance Monitor toolContainerizing HPC and AI applications using E4S and Performance Monitor tool
Containerizing HPC and AI applications using E4S and Performance Monitor tool
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Realtime
RealtimeRealtime
Realtime
 

Más de Hoàng Hải Nguyễn

Más de Hoàng Hải Nguyễn (20)

Building_a_database_with_PHP_and_SQL
Building_a_database_with_PHP_and_SQLBuilding_a_database_with_PHP_and_SQL
Building_a_database_with_PHP_and_SQL
 
Oracle
OracleOracle
Oracle
 
Chapter 6-Remoting
Chapter 6-RemotingChapter 6-Remoting
Chapter 6-Remoting
 
Giao_trinh_CSDL
Giao_trinh_CSDLGiao_trinh_CSDL
Giao_trinh_CSDL
 
notes4
notes4notes4
notes4
 
Introduction to EIGRP  [IP Routing] - Cisco Systems
Introduction to EIGRP  [IP Routing] - Cisco SystemsIntroduction to EIGRP  [IP Routing] - Cisco Systems
Introduction to EIGRP  [IP Routing] - Cisco Systems
 
MySQL-PHP
MySQL-PHPMySQL-PHP
MySQL-PHP
 
RTS introduction
RTS introductionRTS introduction
RTS introduction
 
DichCanKinh_thuchanh
DichCanKinh_thuchanhDichCanKinh_thuchanh
DichCanKinh_thuchanh
 
CCNA S3 - Chapter 04 - VTP
CCNA S3 - Chapter 04 - VTPCCNA S3 - Chapter 04 - VTP
CCNA S3 - Chapter 04 - VTP
 
DiemGiuaky(cnpm)
DiemGiuaky(cnpm)DiemGiuaky(cnpm)
DiemGiuaky(cnpm)
 
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLICCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
CCNA Security Lab 9 - Enabling SSH and HTTPS access to Cisco IOS Routers - CLI
 
Quan ly bo nho trong C#
Quan ly bo nho trong C#Quan ly bo nho trong C#
Quan ly bo nho trong C#
 
notes5
notes5notes5
notes5
 
OOP1_K51
OOP1_K51OOP1_K51
OOP1_K51
 
RFC 1058 - Routing Information Protocol
RFC 1058 - Routing Information ProtocolRFC 1058 - Routing Information Protocol
RFC 1058 - Routing Information Protocol
 
Enhanced Interior Gateway Routing Protocol - Wikipedia, the free encyclopedia
Enhanced Interior Gateway Routing Protocol - Wikipedia, the free encyclopediaEnhanced Interior Gateway Routing Protocol - Wikipedia, the free encyclopedia
Enhanced Interior Gateway Routing Protocol - Wikipedia, the free encyclopedia
 
Phan tich QL ban va mua hang
Phan tich QL ban va mua hangPhan tich QL ban va mua hang
Phan tich QL ban va mua hang
 
notes2
notes2notes2
notes2
 
Giao trinh thuc hanh SQL
Giao trinh thuc hanh SQLGiao trinh thuc hanh SQL
Giao trinh thuc hanh SQL
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Ch3-2

  • 1. Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities: p1>p2>p3, and tasks 1 and 3 share the same critical resource 1
  • 2. Priority Inheritance Protocol In the PIP the priorities of tasks are dynamically changed so that the priority of any task in a critical section gets the priority of the highest task pending on that same critical resource. 2
  • 5. Priority Ceiling Protocol Each resource is assigned a priority ceiling equal to the priority of the highest priority task that can use it 5
  • 8. ORIGINAL CEILING PRIORITY PROTOCOL (OCPP) •Each process has a static default priority assigned (for example, by deadline monotonic scheme: less deadline – greater priority, or by rate monotonic scheme: less period – greater priority). •Each resource has a static ceiling value defined, this is the maximum priority of the processes that use it (assume that greater priority is represented by greater value). •A process has a dynamic priority which is the maximum of its own static priority and any it inherits due to it blocking higher-priority processes (when process blocks higher-priority task it gets temporarily this higher priority). •A process can only lock a resource if its dynamic priority is higher than the ceiling of any currently locked resource (excluding any that it has already locked). 8
  • 9. Original Ceiling Priority Protocol D E E b b Q V E C E b P P b b P P P V V E B P b P P b b P P P P P P E E A E Q P Q P P Q Q P P P P P P P P E 9
  • 10. 10
  • 11. Memory Management Stack management: Ideally, provision of at least one more task than anticipated should be allocated to the stack to allow for spurious interrupts and time overloading 11
  • 13. Swapping A process is saved to an external device when its time expires. The next process is loaded instead Overlays Main(){ a(); b(); c() } This program can be represented as a root segment always resident in memory, and three overlay segments a, b, c Memory required in this case is max(mem_a,mem_b,mem_c) instead of mem_a+mem_b+mem_c 13
  • 14. Partitions Static partitions with absolute addresses Number of partitions and the sizes are fixed. Tasks are compiled for the particular partition. There may be a skew in partitions loading Static partitions with relative addresses Number of partitions and the sizes are fixed. Tasks are compiled for any partition, need adjustment. Happens internal fragmentation Dynamic partitions Number of partitions vary, tasks get partition of the necessary size. External fragmentation can occur => garbage collection (de-fragmentation) 14
  • 16. Virtual Memory Segmented: virtual address = (segment, offset) Address=start(segment)+offset Paged: (page, offset) Address=start(page)+offset Segmented-paged: (segment, page, offset) Address=start(segment)+start(page)+offset Replacement algorithms FIFO, LRU (Least recently used) If we have 4 page memory and 2 4 6 8 is a a page reference string (page 2 is the least and page 8 is the most recently used) then 2 4 6 8 9 2 4 6 8 9 2 4 6 8 9 will lead to page thrashing Memory locking, Working sets 16
  • 17. I/O Problems Disk fragmentation Contiguous file allocation: place parts of a file in adjacent sectors Elevator algorithm: reorder queries so that they will be served with minimal magnetic head replacement Criteria for RTOS 1. Interrupt latency 2. Number of processes system can maintain 3. Memory for OS 4. Scheduling mechanisms set (round-robin, preemptive, etc) 5. Available communication methods (mutexes, semaphores, etc) 6. After sale support 17
  • 18. RTOS Criteria 7. Software development kits available 8. Hardware platforms support 9. Source code availability 10. Task context switch time 11. RTOS cost 12. Compatibility with other RTOS 13. Networks and network protocols supported by RTOS A fitness metric can be 13 M   i  1  i m i 18
  • 19. 19
  • 20. 20
  • 21. POSIX (Portable Operating System Interface for Computer Environments, IEEE Standard) http://www.unix.org/single_unix_specification/ 1. Threads – each process can contain several threads 2. Mutexes and Condition variables - It is essential to associate a mutex with a condition variable. A thread locks the mutex for some shared data and then checks whether data are in the proper state. If no, the thread waits on the appropriate condition variable. Waiting on the condition variable automatically unlocks the mutex. When some thread puts the data in the proper state, it wake a waiting thread by signaling. One thread comes out of its wait state with the mutex locked 21
  • 24. Real-Time POSIX Signals Signals are software representation of interrupts or exception occurrences. No routine should be called from a signal handler that might cause the handler to block. Signals are used for •Exception handling •Process notification of asynchronous event occurrence •Process termination in an abnormal situation •Interprocess communication 24
  • 28. Clocks and Timers Typically the system time is represented by a 32 bit unsigned integer, while tick value (time resolution) is represented by a float-point value If k denotes system tick, and n is the value stored in sys_clock, then the actual time elapsed is kn 28
  • 29. POSIX Clocks POSIX allows many clocks to be used by an application. Each clock has its own identifier of type clockid_t. Commonly supported and used identifier is CLOCK_REALTIME that is systemwide clock visible for all processes. Data structure timespec has two fields of the long integer type representing the value in number of seconds since the Epoch (tv_sec) and in nano-seconds (tv_nsec). Epoch started 00:00:00 1.1.1970 29
  • 33. POSIX Asynchronous Input/Output AIO operations use AIO Control Block aiocb: 33