Month: May 2021

Scheduling metrics and algorithm

Scheduling metrics helps in measuring any scheduling algorithm. The two most important scheduling metrics are: Turnaround Time and the Response Time Turnaround Time:The turnaround of a job is defined as the time at which the job completes minus the time… Read More ›

Destroy a Mutex

The pthread_mutex_destroy() API is used to destroy the mutex object referenced by mutex. Prototype: The pthread_mutex_destroy() function shall destroy the mutex object referenced by mutex; the mutex object becomes, in effect, uninitialized. The mutex must not be used after it… Read More ›

Unlock a Mutex

The pthread_mutex_unlock() API is used to unblock the mutex reference by mutex. Prototype: The pthread_mutex_unlock() function releases the mutex object referenced by mutex. The manner in which a mutex is released is dependent upon the mutex type attribute. If there… Read More ›

Lock a Mutex

The pthread_mutex_lock API is used to lock the mutex referenced by mutex. Prototype: This API is used to lock the mutex object referenced by mutex. If the mutex is already locked, the calling thread is blocked until the mutex becomes… Read More ›

Initialize a Mutex

The pthread_mutex API is used to initialize the mutex referenced by mutex with attributes specified by attr. Prototype: The first argument is the mutex that need to be initialized. The second argument is the attribute pointer which can be NULL… Read More ›

Named pipe vs socket

In a fast local area network (LAN) environment, Transmission Control Protocol/Internet Protocol (TCP/IP) Sockets and Named Pipes clients are comparable in terms of performance. For named pipes, network communications are typically more interactive. A peer does not send data until… Read More ›

Broken pipe error(SIGPIPE)

SIGPIPE is the “broken pipe” signal that the kernel generates when a process writes to a pipe that has been closed by the reader, by default this causes the process terminates. This behavior is useful for typical cases of running… Read More ›

Named pipe Vs unnamed pipe

A few of the important differences between named pipes and un-named pipes are: Named Pipes Unnamed pipes Named pipes are given a name and exist as a file in a system, represented by an inode. mkfifo ( char *path, mode_t… Read More ›