Linux internals: Understanding through Analogies Dr. Jeyakesavan Veerasamy Senior Lecturer University of Texas at Dallas
Topics Linux OS Executable Code : Sharing book Processes & Threads : Factory CPU scheduling : limited # of workers! Synchronization using Semaphores : Assembly line Linux Scheduler : “Smack the head” game Shared memory : dual access from 2 rooms Pipes: Pipes! Mailbox: Delivery through “Chute” Q & A
Linux OS: Layered architecture
Executable “code” pages: sharing books?
Executable “code” pages: Notes Every program uses 3 types of memory: heap, stack & code
Processes & Threads : Factory Work proceeds in several rooms in parallel
Processes & Threads : Notes Heap, Stack and Code memory
CPU scheduling : limited # of workers! distribute to all rooms (or) one room at a time? How to allocate within a room?
Fighting in assembly line Simple case: 2 workers in each section Solutions?
Efficiency in assembly line
Counting semaphores : # of items waiting to be processed
Classic producer-consumer problem
Linux Scheduler: “Smack in the head” game? Priority increases as the waiting time goes up CPU is assigned to highest priority task
Linux Scheduler: “Smack in the head” game But what about real-time vs. other tasks?
Shared memory : dual access from 2 rooms
Pipes : Pipes? cut –f5 –d: /etc/passwd | sort | cut –c1 | sort | uniq –c How many tasks? Small is beautiful.
Mailbox: Similar to pipes but packaged transfer
Questions & Answers Thank you!