Question: A file can be divided into multiple chunks - one chunk for each thread. Assume that the file size is divisible by # of threads

A file can be divided into multiple chunks - one chunk for each thread. Assume that the file size is divisible by # of threads . Each thread can compute the hash value of its assigned chunk. Several of these hash values are then combined to form a string whose hash value can be computed as before. These steps can be repeated till one final hash value remain.
We created a tree of threads to compute fib(n). For this assignment, we will create a complete binary tree of threads. Each leaf thread will compute the hash value of the chunk assigned to it and return the hash value to its parent thread (through pthread_exit() call). An interior thread will compute the hash value of the blocks assigned to it, and then wait for its children to return hash values. These hash values should be combined to form a string:
.

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 Programming Questions!