We can create multiple threads in our C program to execute multiple tasks in parallel. It helps to utilize the CPU resources efficiently. Even though core C programming does not support multithreading, at least until C11 standard, it has a lot of library support for that purpose. POSIX thread or pthread is one of the … Continue reading “Multithreading in C”
Category: C
Multithreading
Let’s first understand few related terminologies before understanding multithreading. Program Program or computer program can be viewed as a set of instructions. We generally write programs in high level languages like C or C++. The computer processors can not execute these programs directly. We compile and link them into a binary equivalent that the processors … Continue reading “Multithreading”
Backpointer – Concept and Application
We often work with data structures with connected nodes – like trees and graphs. In a tree, the parent nodes generally hold the pointers of their child nodes. But the child nodes can also hold the pointer back to their parent. Developers often refer this type of pointers as backpointers. In this diagram, the black … Continue reading “Backpointer – Concept and Application”
Bit Fields in C
The variable size of a standard type is always in bytes – not in fraction of bytes. For example, the size of a char type variable is 1, short type variable is 1, in type variable is 4 and so on. We can not have a variable of size half byte (4 bits) or 1 … Continue reading “Bit Fields in C”
Networking Programming – Introduction to socket
Computer networking programming, often referred as socket programming, is about writing programs to exchange information between processes running on connected hosts – computers, mobiles etc. Hosts are generally interconnected over a private network (LAN) or internet. In fact, the processes can run on a single host or computer also. Most applications today, desktop or mobile, … Continue reading “Networking Programming – Introduction to socket”