[SOLVED] SOLVED:Real-Time Concurrent Systems Lab #4 

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

Part A: Understanding the Java synchronized monitors (lab4a.txt) You are given a threaded program that uses logging to trace the execution of two kinds of threads. You will recognize the Sleepy and Yappy threads. Two logs are maintained: log is unsynchronized and slog is synchronized. slog is synchronized because all accesses to it are surrounded by Java’s synchronized statements.  Load the programs into your Java IDE, read the program and then run it to observe its behaviour.  Answer some questions about the behaviour (in lab4a.txt) o How many entries SHOULD be in the log? o How many entries are in the unsynchronized log? (If you execute the program more than once, give the minimum and maximum values seen) o How many entries are in the synchronized log? (Again, give minimum and maximum values)  Analyse your observations: Is the synchronized log truly protected? (Answer: NO!) Does your evidence support such a statement? Why or why not? (Not!) Explain in terms of the Java code.(I’m not giving you this answer!) Part B: Java Synchronized (lab4b.java) Write a correct version of Part A’s program. Part C: Xenomai Mutex (lab4c.c) Write a Xenomai version of Part A’s program.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.