Download presentation
Presentation is loading. Please wait.
Published byIrma Bates Modified over 9 years ago
1
Instructore: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Concurrent and Real Time programming Introduction
2
Instructore: Tasneem Darwish2 Outlines Concurrency Real time systems
3
Instructore: Tasneem Darwish3 Concurrency Concurrent programming is the name given to the notations that are used to express parallelism in an application program. Concurrent programming also expresses the techniques for dealing with communication and synchronization between parallel entities.
4
Instructore: Tasneem Darwish4 Concurrency why to use concurrency? To fully utilize the processor (the processor is so fast with respect to the I/O devices) To allow more than one processor to solve a problem ( A sequential program can only be executed by one processor. A concurrent program is able to exploit parallelism and obtain faster execution). To model parallelism in the real world (Real-time and embedded programs have to control and interface with real- world entities (robots, conveyor belts, etc.) that are inherently parallel).
5
Instructore: Tasneem Darwish5 Concurrency Concurrency problems: Concurrent activities need to coordinate their actions. the coordination can involve intricate patterns of communication and synchronization. Not managing communication and synchronization very well can result in new error arising.
6
Instructore: Tasneem Darwish6 Concurrency Examples of problems in concurrent programs: deadlock may occur where each concurrent activity is waiting for another to perform an operation interference may occur when two or more concurrent activities attempt to update the same object; this can result in the object's data becoming corrupt; starvation may happen where one or more concurrent activities are continually denied resources as a result of the actions of the others.
7
Instructore: Tasneem Darwish7 Concurrency The desired concurrent program The desired behaviour of a concurrent program is safety and aliveness. The safety property expresses the requirement for "nothing bad to happen“ (the concurrent activities do not interfere with each other and cause data corruption). The aliveness property expresses the requirement that "something good will happen". (concurrent activities are able to make progress and do not suffer from deadlocks or starvation).
8
Instructore: Tasneem Darwish8 Concurrency How deadlocks happen? There are four necessary conditions that must exist if deadlock is to occur. 1.Mutual exclusion (only one concurrent activity can use a resource at once) 2.Hold and Waite (there must exist concurrent activities that are holding resources while waiting for others resources to be acquired) 3.No pre-emption (resources acquired by a concurrent activity cannot be forcibly taken away from it by another activity.) 4.Circular wait (a circular chain of concurrent activities must exist)
9
Instructore: Tasneem Darwish9 Real Time systems real-time systems are systems that have to respond to externally generated input within a finite and specified time interval. They are inherently concurrent because they are often embedded in a larger engineering system and have to model the parallelism that exists in the real-world objects that they are monitoring and controlling. The RTSJ extends the Java concurrency model to allow it to interact with external events.
10
Instructore: Tasneem Darwish10 Real Time systems Some real-time systems characteristics: 1.Large and complex. 2.Extremely reliable and safe. 3.Interaction with hardware interfaces.
11
Instructore: Tasneem Darwish11 Real Time systems Hard and soft real time systems: Hard real-time systems are those where it is absolutely important that responses occur within the specified deadline. Soft real-time systems are those where response times are important, but the system will still function correctly if deadlines are missed. In interactive systems there are no explicit deadlines.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.