Linux internals:Understanding through Analogies
Dr. Jeyakesavan VeerasamySenior LecturerUniversity of Texasat Dallasjeyv@utdallas.edu
Linux OSExecutableCode : Sharing bookProcesses & Threads : FactoryCPU scheduling : limited # of workers!Synchronization using Semaphores : Assembly lineLinux Scheduler : “Smack the head” gameShared memory : dual access from 2 roomsPipes: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 sectionSolutions?
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 upCPU is assigned to highest priority task
Linux Scheduler:“Smack in the head” game
But what about real-time vs. other tasks?
Shared memory :dualaccess from 2rooms
Pipes : Pipes?
cut –f5 –d: /etc/passwd | sort | cut –c1 | sort | uniq –cHow many tasks?Small is beautiful.
Mailbox:Similar to pipesbut packaged transfer
Questions & Answers