In this chapter we shall learn about: 1. API’s used in pthread condition variable 2. Example 1 Below are the API’s used for pthread condition variables 1. To initialize a condition: int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr): Here, cond: It is the condition variable cond_attr: They are …
In this chapter we shall learn about: 1. API’s used in pthread mutex 2. Example 1 3. Example 2 1. To initialize a mutex, use below API: int pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr); attributes for the mutex can be given through mutexattr, use NULL …
In this chapter we shall learn about: 1. Introduction 2. Function prototype for popen() 3. Function prototype for pclose() 4. Simple example for popen() Introduction: Using popen() and pclose() system calls, it is fairy easy to create pipes. Function prototype for popen() FILE *popen ( …