example

Socket programming using the select system call

1.0 Client-Server Paradigm The Client-Server paradigm divides the software architecture of a system in two parts, the server and its clients. The server works in the background and maintains the system-wide database. Using the database, it provides the functions for system operation and responses to queries from the clients. The clients provide the user interface …

Socket programming using the select system call Read More »

Socket Programming using UDP in C

1.0 Datagram sockets There are two major types of network sockets, viz. Stream sockets (SOCK_STREAM) and Datagram sockets (SOCK_DGRAM). The socket type defines the semantics of communication between this socket and its remote counterpart. Stream sockets provide full-duplex reliable sequenced data streams. Datagram sockets support connectionless unreliable messages between the source and destination sockets. Datagram …

Socket Programming using UDP in C Read More »

Socket Programming using TCP in C

1.0 Client-server model Client server model is a software architecture paradigm prevalent in distributed applications. A server has information resources and processes that provide answers to queries and other services to remote clients over the network. Some of the examples of these services are booking an airline ticket and/or a room in a hotel, sending …

Socket Programming using TCP in C Read More »

Signals in Linux

1.0 Signals A signal is a notification delivered to a process by the kernel. A signal indicates that an event has occurred and the process must take note of it. Signals are mostly delivered asynchronously to a process. Whatever the process was doing is suspended and the processing of the signal takes place immediately. 2.0 …

Signals in Linux Read More »

POSIX Shared Memory in Linux

1.0 Shared Memory Shared memory is an inter process communication (IPC) mechanism in Linux and other UNIX-like systems. Based on input parameters, the kernel provides a (shared) memory segment to the calling process. The calling process maps the shared memory segment to its address space. This way, the same shared memory segment can be mapped …

POSIX Shared Memory in Linux Read More »

System V Shared Memory in Linux

1.0 Shared Memory Shared memory is one of the three inter process communication (IPC) mechanisms available under Linux and other Unix-like systems. The other two IPC mechanisms are the message queues and semaphores. In case of shared memory, a shared memory segment is created by the kernel and mapped to the data segment of the …

System V Shared Memory in Linux Read More »

Queue implementation in C using linked list

1.0 Queue A queue is something we see often in our daily lives. People stand in a queue to get into a bus, to get food in a buffet, buy tickets from the ticket counter, etc. Queues are a fair solution of ordering people to get a resource; people are served in the chronological order …

Queue implementation in C using linked list Read More »

POSIX Threads Synchronization in C

1.0 POSIX Threads Synchronization POSIX Threads provide multiple flows of execution within a process. The threads have their own stacks but share the global data and the heap. So the global variables are visible to multiple threads. Also, the threads need to synchronize their actions so that they jointly realize the overall objectives of the …

POSIX Threads Synchronization in C Read More »