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

  Implement a program in python that given names of students

Implement a program in Python that, given 500 names of students and 500 integers in the range (0,100) representing the scores of these 500 students, calculates

  Write a python program that reads the contents of the data

Design an algorithm and use it to write a Python program that reads the contents of the data file into a list. The program should then loop, to allow a user to check various numbers against those stored in the list.

  Develop and test a python program

Develop and test a Python program that displays the day of the week that the following holidays fall on for a year entered by the user New Year's Eve

  Print out the average score accurate to two decimal places

print out the average score accurate to two decimal places.

  Aussie best car abcdeclares that based on its yearly sales

aussie best car abcdeclares that based on its yearly sales it will award a bonus as follows. the bonus will be equally

  Design and implement mini-missions in the haunted house

Create a cheat commands in the game so player can pick up any item he wants from any location in the map. You have to name this cheat command 'giveme'

  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.

  Compare programming with python and programming with scratch

Compare programming with python and programming with scratch. Describe the same program you might create in both programming languages.

  Write recursive function to and the lcs of two input string

Assignment: Introduction to Computer Science for Life Scientists. Write a recursive function to and the LCS of two input string of size n and m.

  Write a python program that will index a set of documents

You are going to write a python program that will index a set of documents and build a function to search through these documents using the index

  Create a python program to decide a small election

Create a Python program to decide a small election for the mythical country of Nerdvana. The method being used to decide that election was.

  Design reusable parameterised functions

create multiple icon styles that can be drawn at different sizes, it would be very repetitive if you tried to code the whole solution using ‘brute force.' Instead you are strongly encouraged to design reusable parameterised functions to draw the i..

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