Linux Context Switching Internals: Process State and Memory

2025-01-02

This article delves into the Linux kernel's representation of processes and their states, focusing on the key data structures: task_struct and mm_struct. task_struct manages the execution state, including process state, CPU time tracking, and scheduling information. mm_struct handles memory state, encompassing page tables, memory segment boundaries, and architecture-specific details. The article thoroughly explains the fields within these structures and their roles in context switching, offering a deep understanding of the Linux kernel's inner workings.

Read more

The Impossibility Theorem of Clustering: Why Perfect Algorithms Don't Exist

2024-12-26

This article explores the 'impossible triangle' problem in clustering algorithms. Drawing a parallel to the CAP theorem, the author argues that every clustering algorithm must sacrifice one of three desirable properties: scale invariance, richness, and consistency. The article defines each property and illustrates how algorithms like k-means compromise on one to achieve the others. The conclusion emphasizes that developers should choose algorithms based on the specific needs of their application, accepting that a perfect clustering algorithm is mathematically impossible.

Read more