Programming Homework Help

CSCI 3120 C Programming Mining Blocks Project

 

Problem Statement
Extend your program from Assignment 2 (or the provided solution) to make your miner multithreaded so
that it spawns multiple threads when searching for the nonce. Your program must be compiled to an
executable called miner. The program will read in five events. The events are the same events as in
Assignment 2, except that the mine event will now take one parameter, specifying the number of threads
that should be created to search for the nonce.
1 This background description assumes that you have read and understood the background for Assignment 1 and 2.
Please see the Problem Statement in Assignment 1 and Assignment 2 for a description of the events.
On a mine event, your program must do the following:
1. Construct the block in the same manner as in Assignment 2.
2. When searching for the nonce, your program must spawn the specified number of threads and
each thread will search a portion of the search space (see Processing Section for details).
3. Once the nonce is found, the threads should be destroyed and the rest of the computation proceeds as in Assignment 2.
Note: the changes to the simulator in Assignment 3 deal with how the nonce is selected. All other functionality remains the same.