A Sudoku puzzle uses a 9 X 9 grid in which each column and r

A Sudoku puzzle uses a 9 X 9 grid in which each column and row, as well as each of the nine 3 X 3 subgrids, must contain all of the digits 1 to 9

Please design a multithreaded application in C with Pthreads - it ditermines whether the solution to a Sudoku puzzle is valid. there are several 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 digits 1 through 9 without duplication.

* a thread to check that each row contains digits 1 through 9 without duplication.

* nine threads to check that each of the 3 X 3 subgrids contains the digits 1 through 9 without duplication.

this would results 11 seperate threads. However, you are welcome to create even more threads for this project. For example, rather than create one thread that checks all nine columns, you could create nine seperate threads and have each of them to check one column.

Each worker thread is assigned the task of determing the validity of a particular region of the Sudoku puzzle. once a worker has performed this check, it must past its results back to the parents. One good way to hanlde this is to create a array of integer values that is visible to each thread.

In your program, please hard-code the 9X9 grid with the solution as follow and take a greenshot of your program execution.

6,5,3,1,2,8,7,9,4

1,7,4,3,5,9,6,8,2

9,2,8,4,6,7,5,3,1

2,8,6,5,1,4,3,7,9

3,9,1,7,8,2,4,5,6

5,4,7,6,9,3,2,1,8

8,6,5,2,3,1,9,4,7

4,1,2,9,7,5,8,6,3

7,3,9,8,4,6,1,25

Pleae note:

1. each invocation the program always prints out \"CS149 Sudoku from Firstname Lastname\" only one. the program can then print out the 9X9 grid to stdout before it prints the final result (valid Sudoku or not) to stdout.

2. Any API in a multi- threaded application should be thread-safe.

3. High level description of exact steps for each thread.

Can you guys help me this Homework? It will be due on Monday. I am so busy at this time because of Midterms.

Thank you so much.

Solution

A Sudoku puzzle uses a 9 X 9 grid in which each column and row, as well as each of the nine 3 X 3 subgrids, must contain all of the digits 1 to 9 Please design

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site