Assignment 4
(1) Write a program to pass an integer token value around all processes in a ring-like fashion, and make sure that it does not have a deadlock. Input Format: Input contains two space-separated integers denoting the number of processes and the token value respectively. Output Format: Check sample output. Sample Input: 5 1 Sample Output: Process 1 received token 1 from process 0. Process 2 received token 1 from process 1. Process 3 received token 1 from process 2. Process 4 received token 1 from process 3. Process 0 received token 1 from process 4.(2) Parallel Merge Sort: Given an array of numbers, your task is to return the array in sorted order by implementing parallel merge sort. Input Format: The rst and the only line of input contains an array of integers. Output Format: Output your answer as a space-separated array. Sample Input: 7 -1 4 9 -8 0 6 Sample Output: -8 -1 0 4 6 7 91
Reviews
There are no reviews yet.