Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

TASK 3 : Finding prime numbers from multiple text files using multithreading ( 1 5 % - 1 0 0 marks ) You will be

TASK 3: Finding prime numbers from multiple text files using multithreading (15%-100 marks)
You will be given files containing a list of numbers. The amount and numbers themselves will be random. You will create a C program which counts the number of prime numbers there are within the files and output to a file the amount of prime numbers found, along with the prime numbers themselves. The aim of this task is to use POSIX threads to parallelise the task to take advantage of the multicore processor within your machine to speed up the task. The threads you spawn within the program must compute an equal or close to an equal amount of computations to make the program more efficient in relation to speed. For this section, you will be reading the data from three files and splitting it across many threads, you should load in the data from files and split the data into equal parts, then process each slice within your threads. This task also tests your knowledge of dynamic memory allocation. NOTE - this program should work with any amount of threads.
Creating an algorithm to detect prime numbers (10 marks)
Using dynamic memory -malloc(20 marks)
Using multithreading with equal computations (50 marks)
Outputting correct output to a file (20 marks) In c programming
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

40 Job pricing and pay structures.

Answered: 1 week ago