Computer Science Write a C++ language program that reads the file numbers.txt having 10,000 random integers ranging from 1-1,000,000. It takes an input argument num_jobs with a value between 1 and 8. E.g. if num_jobs is 3, it splits into 3 parallel processes using fork() function and each process then calculates prime numbers from a subset of the input data. Together these 3 jobs find prime numbers from all the 10,000 input integers. The overall parent process then combines the results from its children into a single file prime.txt. NOTE: The key part is to solve it with fork()

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 5PE
icon
Related questions
Question

Computer Science

Write a C++ language program that reads the file numbers.txt having 10,000 random integers ranging from 1-1,000,000. It takes an input argument num_jobs with a value between 1 and 8. E.g. if num_jobs is 3, it splits into 3 parallel processes using fork() function and each process then calculates prime numbers from a subset of the input data. Together these 3 jobs find prime numbers from all the 10,000 input integers. The overall parent process then combines the results from its children into a single file prime.txt.

NOTE: The key part is to solve it with fork()

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning