What sort of distributed system architecture would you use

Assignment Help Python Programming
Reference no: EM131952481

Assignment

1. One of the most challenging aspects of both Real Time Embedded and Distributed Systems is process coordination - coordinating computational processes which are running in parallel. Threads are a concept used to execute different code on different CPUs simultaneously on the same machine. We will use this concept, and implementations of it in the Python programming language, to explore issues associated with parallel processing .

Consider Assignment5.py. It starts with a vector (100 elements - 1 to 100) and uses 200 threads to increment each element of the vector by 1 (+1 each).

Part 1. Review and run Assignment5.py several times, and explain the results. Are they what you expect? Why or why not? Note: I have checked this on several machines, but I can't guarantee that you will always see the anomalies I'm trying to demonstrate. The numerically correct answer is range(201,301). If you do see that correct answer, imagine that the following was generated, instead, for the purposes of answering this question.

2091_Final-List.jpg

Part 2.One line of python code may translate to several instructions that occur on the CPU. Consider the self.l[self.iteration] = self.l[self.iteration] +1statement. In it, at least 3 things are happening seriallywithin a thread: read the current value of the vector element, calculate the new value of the element, and write the new value of the element. Why is this relevant?

Part 3. Remove the comments around the lock.acquire(), lock.release(), and lock = threading.Lock() calls in Assignment5.py and run it several times. Explain the results. Are they what you expect? Why or why not?

Part 4. This is a simple (and small) example of process coordination. "Real" applications and/or distributed systems can have 100s of threads and/or processes all doing different activities. How does this complexity impact the Software Systems Engineering of such systems?

2. Imagine that you'd like to take Assignment5.py, and instead of distributing the work to individual threads, you'd like to use individual machines (i.e., a distributed system).

Part 1 What sort of distributed system architecture would you use for this problem, and why?

Part 2 Which aspects of building the solution would be similar to the thread solution? Which aspects would be different?

3. In Assignment5.py, consider the use of the range() function.

Part 1 Why is it better to reuse this function than write out a 100 element vector?

Part 2 Now imagine that the range function was another piece of code that you could reuse, but you had to pay for the right to use it. What factors would go into your decision on whether you use it (i.e., pay for it) vice not (i.e., writing out the vector using another tactic)?

Part 3 If, instead of range(), the reuse question was for random.randint() or all of the thread functions, would that change the answer to your question? Why or why not?

4. Explain the difference between Service Oriented Architect and Web Services.

Attachment:- Assignment.rar

Reference no: EM131952481

Questions Cloud

How the optimization version of vertex cover problem : [Self-reducibility] Show how the optimization version of vertex cover problem is polynomial time-reducible to its decision version.
What is the probability that the system will work : What is the probability that the system will work? Draw the diagram of the new system.
Write down the normal form representation of this game : Write down the normal form representation of this game, describing the three essential elements of the game.
Should sharon jones outsource its it services : Calculate the total costs of the production departments (clothing and eyewear) after the support department costs of information technology.
What sort of distributed system architecture would you use : What sort of distributed system architecture would you use for this problem, and why? Why is it better to reuse this function than write out 100 element vector?
Describe the role of operating systems : MN404 - Fundamentals of Operating Systems and Programming - Describe the role of Operating Systems (OS) and its different subsystems in controlling computer
To what extent are anxiety and powerlessness correlated : To what extent are anxiety and powerlessness correlated? Is there a causal relationship between the two?
How christians are lulled and desensitized : In C. S. Lewis's The Screwtape Letters,* the conversations indicate how Christians are lulled and desensitized.
Effective method of studying for an exam : Research demonstrates that the most effective method of studying for an exam is exposure to the material through "spaced repetition" over time

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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