Reference no: EM132399426
Part 1:Short essay:
a. Compare and contrast the way a protected functionin Ada works versus how a nonsynchronizedmethod in a Java class works when the class has other methods that aresynchronized.
b. Section 2.4 in the Study Guide describes exclusive access to shared domainresources. Describe in your own words how this can be implemented with:
threads that software-enhancedomain devices such as robots (2.4.1) and a semaphore safe object that safeguardsthe shared domain resource (2.4.2).
Use either robots and conveyors orplayers and chairs (in the musical chairs problem) as examples (or some different problem altogether).
Slides toward the end of the "Ada" chat may also be useful.
Note again. Whenever you're asked to "use your own words," please do not try to replace technical terms such as "thread," "object," "safe object," "threading," "tasking," etc., with your own words!
Part 2:Draw a simple state diagram of the "life" of a rental car:
The "life" of a rental car includes the events purchase, when the car is bought, and register, when it is registered.
The car is regularly serviced. This involves two events, start-serviceand end-service.
When the car is not being serviced, there may be zero or more occurrences of the event rentwhen the car is rented out.
The final event in the car's life is either sellor scrap.
Before the car is purchased, let it exist in a state called Initial. Other than that, define appropriate states as necessary.
The example of page 75 of Sandén (2011) can be a useful model.