Os Lab Assessment-2
Os Lab Assessment-2
SLOT: L27-28
OUTPUT:
C) Assume that two processes named client and server running in the system. It is required
that these two processes should communicate with each other using shared memory
concept. The server writes alphabets from a..z to the shared memory .the client should read
the alphabets from the shared memory and convert it to A…Z. Write a program to
demonstrate the above mentioned scenario. (Medium)
SERVER CODE:
CLIENT CODE:
OUTPUT:
D) Write a multithreaded program that calculates various statistical values for a list of
numbers. This program will be passed a series of numbers on the command line and will then
create three separate worker threads. One thread will determine the average of the
numbers, the second will determine the maximum value, and the third will determine the
minimum value. For example, suppose your program is passed the integers 90 81 78 95 79 72
85 , the program will report the average value as 82. The minimum value as 72. The maximum
value as 95. The variables representing the average, minimum, and maximum values will be
stored globally. The worker threads will set these values, and the parent thread will output
the values once the workers have exited. (High
OUTPUT:
CPU SCHEDULING
(a) Implement the various process scheduling algorithms such as FCFS, SJF, Priority (Non
Preemptive)
(b) Implement the various process scheduling algorithms such as Priority, Round Robin
(preemptive).
CODE:
OUTPUT:
DATA:
FCFS:
SJF (PRE EMPTIVE)
CODE:
FCFS
OUTPUT:
FCFS
CODE:
SJF
OUTPUT:
d. Simulate with a program to provide deadlock avoidance of Banker’s Algorithm including
Safe state and additional resource request
CODE:
OUTPUT: