Unnamed Semaphore in Linux User space

As the name suggests, the semaphore does not have a name in the Linux File system. These semaphores are also called as memory-based semaphores. since, the semaphore does not have a name associated with it in the Linux File system, the semaphore needs to be placed in a shared memory region that different processes or […]

Named Semaphore in Linux user space

Named semaphores as the name suggests have a name in the Linux file system. Hence different unrelated processes or threads can open the semaphore by invoking the name. The Named semaphore can be created or an existing instance opened by invoking the “sem_open” API. The API is shown below The name identifies the semaphore. The […]

Locking Mechanisms for Threads

Since Threads share the global heap, initialized data and uninitialized data segment with one another, it is possible that there would be race conditions between two threads. To prevent race conditions and to set up synchronization between the different threads, POSIX supports the following locking or thread synchronization mechanisms. POSIX Semaphores: named semaphores The semaphore […]

POSIX Threads in Linux

Threads are a mechanism that permits an application to perform various tasks. The thread has its own stack but it shares the global memory of the parent process which includes initialized data, uninitialized data, and heap segments. The memory segment sharing is shown below: The threads spawned by a process can execute concurrently. Threads provide […]

Handling Receive packets via NAPI

NAPI stands for New API though currently it is not so new 🙂 . The network driver receives a large number of packets and at a fast pace. For each packet, if a Hardware IRQ is raised, the software driver would need to wake up for each interrupt and handle the packets. Interrupt service processing […]

How is Data packet TX/RX handled?

In a previous article <Network device driver interfaced to a Hardware peripheral>, we saw how a networking device driver which is connected to a peripheral hardware device is instantiated at its lower edge and later the driver creates a net device interface for the Linux system to access. The below image from the article will […]

wpa_supplicant and hostapd configuration files

In the previous articles, we have seen the path to configuration of 802.11 parameters in Linux follows nl80211, cfg80211, mac80211 and softmac driver via callbacks and netlink sockets. It is also seen that in the case of a fullmac driver, mac80211 is not used but configuration flows directly to the fullmac driver from cfg80211. The […]