using N processes to sum up n trapezoids. N should vary in the range of 1 to 8, while n = 64. We should have learned in Calculus that the following holds. ∫ 2 x=0 1 x + 1 dx = ln(x + 1)|2 0 = ln 3 ≈ 1.0986123. The controller process should create N (∈ [1, 8]), worker processes using fork() and other appropriate system calls, as you see fit. To facilitate the inter-process communication, there should be N pairs of pipes through which the controller assigns jobs to associated worker processes, and receives results back from th

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Come up with a C program to use the trapezoidal rule 1 to approximate the integral of
∫ 2
x=0 1
x+1 dx, by using N processes to sum up n trapezoids. N should vary in the range of 1
to 8, while n = 64.
We should have learned in Calculus that the following holds.
∫ 2
x=0
1
x + 1 dx = ln(x + 1)|2
0 = ln 3 ≈ 1.0986123.
The controller process should create N (∈ [1, 8]), worker processes using fork() and
other appropriate system calls, as you see fit. To facilitate the inter-process communication,
there should be N pairs of pipes through which the controller assigns jobs to associated
worker processes, and receives results back from them when the calculation is completed.
More specifically, the controller process will initially assign the first N pieces to the
N worker processes to do their respective calculation. Whenever a process has done its
calculation of the area of another trapezoid, it will send it back to the controller. Upon
receiving such a piece, the controller process will update the sum accordingly, and, if there
are still un-calculated pieces, the controller will also assign the next piece to the just returned
worker process.
After the controller has received all the 64 results, it prints out the final answer, which
should be within a reasonable range of 1.0986. 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Approximation Algorithms
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education