Communication of processes and process synchronization

Assignment Help Operating System
Reference no: EM13831963

Learning Objectives

The learning objectives of this assignment are to apply the knowledge in the course including multi-processes programming, multithread programming, communication of processes and process synchronization to solve a complex problem which involves multiple sides working together. This assignment requires the design, development, testing, and debugging skills of C language.

Specifications

Four external processes will communicate temperatures to a central process, which in turn will reply with its own temperature and will indicate whether the entire system has stabilized. Each process will receive its initial temperature upon creation and will recalculate a new temperature according to two formulas:

new external temp = (10*myTemp + centralTemp) / 11;

new central temp = (centralTemp + 1000* temp sum of external processes) / (1000*number of external processes + 1);

Initially, each external process will send its temperature to the central process through mailbox. If all external temperatures are exactly the same as that of the central process, the system has stabilized. In this case, the central process will notify each external process that it is now finished (along with the central process itself), and each process will output the final stabilized temperature. If the system has not yet become stable, the central process will send its new temperature to each of the external processes through mailbox and await their replies.

The processes will continue to run until the temperature has stabilized. The C programs of the external and central are given in Appendix (note don't remove instruction usleep(100000) in all tasks in this assignment). Compile and run as follows

#./external 10 1 &
#./external 100 2 &
#./external 1000 3 &
#./external 10000 4 &
#./central 10 &

Task-1. Simple Extension

Write central8.c and external8.c to perform the same task as described by the specifications where 8 external processes are considered. Compile and run as follows:

#./external8 10 1 &
#./external8 100 2 &
#./external8 1000 3 &
#./external8 10000 4 &
#./external8 50 5 &
#./external8 500 6 &
#./external8 5000 7 &
#./external8 50000 8 &
#./central8 10&

Task-2. Serve Two Group

Now consider there are two groups of external processes where the first group has external process 1-4 and the second group has external process 5-8. Each group of external processes communicate with the central to perform the same task as described by the specifications. The central process is with a single thread of control. For the first and second group, the initial temperature in the central is 10 and 100 respectively. Write central44.c and external44.c. Compile and run as follows (record the central process running time):

#./external44 10 1 1200 &
#./external44 100 2 1200 &
#./external44 1000 3 1200 &
#./external44 10000 4 1200 &
#./external44 50 5 1300 &
#./external44 500 6 1300 &
#./external44 5000 7 1300 &
#./external44 50000 8 1300 &
#./central44 10 100 1200 1300 &

Task-3. Multithread Programming

Perform the same task as described in Task-2 but the central process is with two threads of control. Each thread is corresponding to one group of external processes. Write central442T.c and external442T.c. Compile and run as follows (record the central process running time):

#./external442T 10 1 &
#./external442T 100 2 &
#./external442T 1000 3 &
#./external442T 10000 4 &
#./external442T 50 5 &
#./external442T 500 6 &
#./external442T 5000 7 &
#./external442T 50000 8 &
#./central442T 10 100 1200 1300 &

Assignment Report

The report should include a cover page to indicate the course title, course code, semester information, assignment #, assignment total marks, your lab time, your lab assistant name, your name, your student identity. The body of the report includes

1. Introduction

It should include a brief introduction of the assignment, the brief description of the system, the summary of what you have done in this assignment and the most important experience/lessons learned.

2. Assignment Tasks

2.1. Task - 1

The summary of your solution (including what you have done in central and external); Self-reflection and/or lessons learned; Report the converged temperature; Report the execution time of central; Report the demonstration date.

2.2. Task - 2

The summary of your solution (including what you have done in central and external); Self-reflection and/or lessons learned; Report the converged temperature for two groups respectively; Report the execution time of central process; Report the demonstration date.

2.3. Task - 3

The summary of your solution (including what you have done in central and external); Self-reflection and/or lessons learned; Report the converged temperature for two groups respectively; Report the execution time of central process; Report the demonstration date.

3. Analysis

3.1. Multithread Efficiency

Compare and contrast task-2 and task-3 in terms of execution time of central process. Provide explanation to your observation.

3.2. Synchronization

Analyse whether task-3 requires semaphore for process synchronization or not in your code, and explain your decision.

Verified Expert

Reference no: EM13831963

Questions Cloud

Write a paragraph about reflection on yemen martyrs : Write a paragraph about reflection on Yemen martyrs and what we know about Yemen.
What was the importance of additional land acquired through : what was the importance of additional land acquired through westward expansion
Write a paragraph about a book : Write a paragraph about a book that is the best and has a beautiful ending.
Determining the particular terminal price : Given the initial DEW price of $40, what are the probabilities of observing each of the four terminal stock prices in one year? (Hint: In arriving at your answer, it will be useful to consider (1) the number of different ways that a particular ter..
Communication of processes and process synchronization : Multi-processes programming - multithread programming and communication of processes and process synchronization
When constructing parallel and perpendicular lines how same : When constructing parallel and perpendicular lines, how are the steps similar
Interview someone who is responsible for it security : Identify and interview someone who is responsible for IT security (e.g., compliance, privacy, risk, or quality). To assist in formulating salient questions, view the terms (see assigned readings related to "Health Information Exchange."
Implementation of the employee free choice act : Much political effort has been given to the passage and implementation of the "Employee Free Choice Act." Your local U.S. representative has asked you, the local HR group president, to submit a position paper to her regarding the HR group's positi..
What is the department role within the organization : What is the department's role within the organization, and what are its responsibilities? What are the client needs or services that are addressed by this department

Reviews

Write a Review

Operating System Questions & Answers

  Develop a profile of your personality characteristics

Assignment: Finding the Leader in You: Self-Assessment / Johari Window, The Johari Window emphasizes that we may not be aware of everything that there is to know about ourselves

  Identify the costs associated with security requirement

A year after your 1st visit to credit union the manager calls you once again. His business is experiencing tremendous growth and requires to either open another branch office.

  Requirement for routers to support ipv4 and 6 protocol stack

The answer describes the requirement for routers to support both IPv4 and IPv6 protocol stacks and describes the several types of connections a dual stack router can support, and why such connections are necessary.

  Question 1a give three advantages of parallel systemb

question 1a give three advantages of parallel systemb explain what is symmetric multiprocessing and asymmetric

  Question 1a differentiate between a standard user and a

question 1a differentiate between a standard user and a root user in linuxb name any five duties of a system

  What is the capacity of the hard disk drive

What is the capacity (in MB) of the hard disk drive and what is the access time (in ms)?

  Assume a gpu architecture that contains 10 simd

Assume a GPU architecture that contains 10 SIMD processors. Each SIMD instruction has a width of 32 and each SIMD processor contains 8 lanes for single-precision arithmetic and load/store instructions, meaning that each non- diverged SIMD instruct..

  Which page will lru replace

which page will NRU replace?B) which page wil FIFI replace?C) which page will LRU replace?

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Question about virus defense

Discuss how can an individual machine get infected with the virus you are researching and how does it spread to other equipments?

  Standards in the field of wireless networking

Do you consider that standards are beneficial in the field of wireless networking or do you feel they limit new technologies?

  Minimum and maximum size of an ethernet frame in bytes

Determine the minimum size and Maximum size of an Ethernet frame, in bytes?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd