1.IPC using Shared memory Write a C program using the concep...
Prompt
1.IPC using Shared memory Write a C program using the concept of shared memory. Consider two processes: a sender process and a receiver process. Create these two processes with the filenames as sender.c and receiver.c. The sender process sends a string to the receiver process. The receiver process will then check whether the string is a palindrome or not and display the result in the receiver process. Use necessary system calls to implement the same. 2.IPC using Message Passing 2. Write a C program to implement inter process communication using message queue. Create two processes P1 and P2. The process P1 takes a string and passes it to the process P2. After receiving the string, the process P2 concatenates it with another string without using string function and sends it back to the process P1 for printing the result. Use fork () and pipe () for implementing the above program. 3.1. Write a C program to demonstrate the concurrent execution of a single process that creates three threads in which the first thread must print the sum of first N natural numbers, the second thread must print the sum of first N odd natural numbers and the third thread must print the sum of first N even natural numbers. 4.1. Write a C program to implement FCFS, SJF, SRTF Scheduling Algorithms for the given data. Calculate the average turnaround time and average waiting time for each. Process Arrival time Burst time P1 0 5 P2 1 3 P3 2 8 P4 3 6 4.2. Write a C program to implement Round Robin and Priority Scheduling (combined). Given the time quantum of 2ms. Calculate the average turnaround time. Process Burst time Priority P1 4 3 P2 5 2 P3 8 2 P4 7 1 P5 3 3 5.Write a C program to demonstrate disk scheduling algorithms; FCFS, SSTF, SCAN and C – SCAN for the data given below. For SCAN and C- SCAN note that the disk arm should move "towards the larger value". The order of request is, (82, 170, 43, 140, 24, 16, 190) and current position of Read/Write head is 50. Maximum cylinder limit is 200. 6.Write a C program to implement the Producer Consumer Problem in OS using, (a) mutex lock (b) semaphore 7. 1. Using C program, implement the classical process synchronization problem, “The Dining Philosophers Problem” using semaphores. The number of philosophers must be 5. 2. Write a C Program to illustrate the Banker’s algorithm. Consider a system with five threads T0 through T4 and three resource types A, B, and C. Resource type A has ten instances, resource type B has five instances, and resource type C has seven instances. Suppose that the following snapshot represents the current state of the system: Allocation Max Available A B C A B C A B C T0 0 1 0 7 5 3 3 3 2 T1 2 0 0 3 2 2 T2 3 0 2 9 0 2 T3 2 1 1 2 2 2 T4 0 0 2 4 3 3 Find the Need matrix and check whether the system is safe or not. If there exists a safe state, then display the safe sequence. • Can request for (1, 0, 2) by T1 be granted? • Can request for (3, 3, 0) by T4 be granted? • Can request for (0, 2, 0) by T0 be granted? 8. Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and 250 KB. These partitions need to be allocated to four processes of sizes 357 KB, 210 KB, 468 KB and 491 KB in that order. Perform the allocation of processes using- 1. First Fit Algorithm 2. Best Fit Algorithm 3. Worst Fit Algorithm Write a C program to simulate the problem above. 9.Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6, 2, 3, 0, 1. Assuming demand paging with three frames, how many page faults would occur if page replacements algorithms are used? Write a C program to illustrate the solution for the above problem using the following page replacement algorithms. (1) FIFO (2) LRU (3) Optimal Now give me master prompt to build a webpage that teaches me these problems. Each one should contain c++code. The interactove tools should be more interactive. FOr example: Mergesort, if i click next the array should divide into two parts and the corresponding code should be highlighted and explained. Like this. I have said what is best for merge sort. You decide what is the best way of interactive tool for every other. But the interactive tool should such a way that i operate it not just a simple diagram Give me master prompt. If you have any doubts go with the recommended one.
Response not available
Response not available