/Operating-System-Semaphore--Producer-and-Consumer-are-part-of-an-application.-The-producer-access-a

Producer and Consumer are part of an application. The producer access a two dim matrix of int (of 100 x 100) and produces the memory address as an item and store it in a array of pointers to int. The consumers compete and get an entry of the array that corresponds to a row, and finds the number of primes in that row and adds it to a shared sum

Primary LanguageC

Semaphore---Producer-and-Consumer-are-part-of-an-application.-The-producer-access-a-two-dimensional

Problem:

Producer and Consumer are part of an application. The  producer access a two dim matrix of int (of 100 x 100) and produces the memory address as an item and store it in a array of pointers to int. The consumers compete and get an entry of the array that corresponds to a row, and finds the number of primes in that row and adds it to a shared sum variable.
The consumer at the end will print the result as the number of primes in the matrix.