Question: Welcome to this programming assignment designed to enhance your understanding of the impact of sequential, multithreaded, and multiprocessing programming in Python. This assignment focuses on
Welcome to this programming assignment designed to enhance your understanding of the impact of sequential, multithreaded, and multiprocessing programming in Python. This assignment focuses on engaging the CPU in heavy computational tasks and examining the execution times with different concurrency models. For this assignment, use a list of five large prime numbers. You can use the same number times. The number should be big enough to keep the program busy for a few seconds. Part : Sequential, Multithreaded, and Multiprocessing Programs Program : Sequential Prime Checker Write a Python program that sequentially checks whether a given number from a list of large numbers is prime. Implement a function to perform the primality check and print the result accordingly. Program : Multithreaded Prime Checker Write a multithreaded version of the previous program. Spawn a thread for each number in the list, and print the results. Program : Multiprocessing Prime Checker Write a multiprocessing version of the previous program. Spawn a thread for each number in the list, and print the results. Part : Data Collection and Analysis Use time.perfcounter command at the beginning and the end of each program to find their execution durations. Run each program with and numbers in the list and note down the duration required to complete each type of program. Compile the collected data into a chart showing execution times for sequential, multithreaded, and multiprocessing programs with varying numbers in the list. Please provide a written analysis of the observed trends in computation times for each concurrency model. Which model worked faster and why? Part : Extended Execution and Analysis If the programs complete in less than seconds, replace the numbers in the list with larger prime numbers obtained from the internet. Open relevant program monitors eg Task Manager to identify multiple threads and processes in action as reported by the OS Do they correspond to the number of entries in the list of prime numbers? Take screenshots to support your observations. Ensure you submit your Python scripts, chart, and analysis in a neatly organized report. Your report should include insights into the observed trends in computation times for each concurrency model. Feel free to assume logically for any detail not specified in the assignment. Make a note of it in the report.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
