Question
Please edit this code and use as a guideline ? #include #include #include /* You will need a structure to store the information to be
Please edit this code and use as a guideline ?
#include
#include
#include
/* You will need a structure to store the information to be passed to each thread (see "Passing Parameters to Each Thread" in the textbool's project description)*/
/* Declare the thread that checks columns */
void *column_worker(void *param); // the function parameter is for the structure you defined
/* You will also need to declare threads that checks rows and 3x3 subgrids */
/* You will need to declare an array of integer values that is visible to each thread. The value in the array (0 or 1) indicates whether the worker thread's number is valid (see "Returning Results to the Parent Thread" in the textbook's project description) */
int main(int argc, char *argv[])
{
/*You need to assign values to the structure variable. Then you can create multiple worker threads by passing the information using the structure variable*/
/*You need to call pthread_join() for each childer thread so that the parent will wait*/
/* Finally, after all children returns, you can check the status array that is visible to everyone and see if it is valid. You then print out the final checking result*/
return 0;
}
/*thread code for child checking all columns*/
void *column_worker(void *params)
{
pthread_exit(0);
}
/* also need to define threads for checking rows and 3x3 subgrids */
Project 1-Sudoku Solution Validator A Sudoku puzzle uses a 9 9 grid in which each column and row, as well as each of the nine 3 3 subgrids, must contain all of the digits 1 . . . 9. Figure 4.19 presents an example of a valid Sudoku puzzle. This project consists of designing a multithreaded application that determines whether the solution to a Sudoku puzzle is valid. There are several different ways of multithreading this application. One suggested strategy is to create threads that check the following criteria: A thread to check that each column contains the digits 1 through 9 .A thread to check that each row contains the digits 1 through 9 Nine threads to check that each of the 3 3 subgrids contains the digits 1 through 9 This would result in a total of eleven separate threads for validating a Sudoku puzzle. However, you are welcome to create even more threads this project. For example, rather than creating one thread that checks all nineStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started