Operating system (OS)

An operating system is system software that manages computer hardware, software resources, and provides common services for computer programs.

Socket Options

A few of the common socket options are: SO_REUSEADDR:This is to report whether the same port can be reused again that is socket can be bind to the same port or not. This is a Boolean option. SO_KEEPALIVE:This is to… Read More ›

Socket Programming

Client-Server communication Sockets Procedures socket() : Create a socket bind(): Name a socket connect(): Request a connection listen(): Listen for a new connection accept(): Accept a new connection send()/sendto(): Send data over connection recv()/recvfrom(): Recv data over communication close(): Close… Read More ›

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 ›