Analyze the sequence of execution in the program above. There isonly 1 child thread. Assume semaphores decrement for each blockedthread. As the program is executed, list the order of occurrencefor the following:
(a) Write every output line (printf’s are in bold).
(b) List every change to any of the four semaphores (mutex, next,notfull, and notempty) with the new value.
(c) For every semaphore change in (b), briefly explain whichthread (parent or child) made the change.
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <semaphore.h>
#define N 10
#define BUFFER_SIZE 5
// Struct for condition variable
struct condition {
sem_t sem; // Semaphore to be initialized to 0
int count; // Count of
PayPal Gateway not configured
PayPal Gateway not configured