Question: Part 1 : Sequential, Multithreaded, and Multiprocessing Programs Program 1 : Sequential Prime Checker Write a Python program that sequentially checks whether a given number

Part 1: Sequential, Multithreaded, and Multiprocessing Programs Program 1: 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 2: 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 3: 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 2: Data Collection and Analysis Use time.perf_counter() command at the beginning and the end of each program to find their execution durations. Run each program with 5,6,7, and 8 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 3: Extended Execution and Analysis If the programs complete in less than 5 seconds, replace the numbers in the list with larger prime numbers obtained from the internet. Open relevant program monitors (e.g., 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!