My homework in operating systems class. The exercise was about checking the correctness of Sudoku through processes and threads.
the processes homework: My task was to make software that checks whether a Sudoku board is correct or not. In both parts, the main process will create three children processes by calling fork(). Each child has a different role(the first will check the rows, the second will check the columns, and the third will check the squares). the communication between the parent and the children will take place in two configurations. First configuration using Pipes. Second configuration using mmap.
the threads homework: My task was to make software that checks whether a Sudoku board is correct or not. The task was divided into two cases: The first case was to create 27 threads with each thread checking one row or one column or one square. Finally, the program updates whether or not the Sudoku is correct. A second case is to create 27 tasks (column 1, line 6, square 4, and so on) in the main thread and then create N threads and let them run. The threads must take one task from the data structure at a time until all the tasks are finished (mutex must be used).