Month: April 2021

Odd Even problem by two threads

The problem is to print odd and even number by using two threads respectively #include <stdlib.h> #include <string.h> #include <pthread.h> #include <string.h> #include <stdio.h> #define MAX 10 pthread_cond_t cond_var =PTHREAD_COND_INITIALIZER; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; int count =1; void *odd_fun(void *arg)… Read More ›