Linux internals Understanding through Analogies Dr Jeyakesavan Veerasamy

  • Slides: 18
Download presentation
Linux internals: Understanding through Analogies Dr. Jeyakesavan Veerasamy Senior Lecturer University of Texas at

Linux internals: Understanding through Analogies Dr. Jeyakesavan Veerasamy Senior Lecturer University of Texas at Dallas jeyv@utdallas. edu

Topics • • • Linux OS Executable Code : Sharing book Processes & Threads

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

Linux OS: Layered architecture

Executable “code” pages: sharing books?

Executable “code” pages: sharing books?

Executable “code” pages: Notes • Every program uses 3 types of memory: heap, stack

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 : Factory • Work proceeds in several rooms in parallel

Processes & Threads : Notes • Heap, Stack and Code memory

Processes & Threads : Notes • Heap, Stack and Code memory

CPU scheduling : limited # of workers! • distribute to all rooms (or) one

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?

Fighting in assembly line • Simple case: 2 workers in each section • Solutions?

Efficiency in assembly line

Efficiency in assembly line

Counting semaphores : # of items waiting to be processed

Counting semaphores : # of items waiting to be processed

Classic producer-consumer problem

Classic producer-consumer problem

Linux Scheduler: “Smack in the head” game? • Priority increases as the waiting time

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

Linux Scheduler: “Smack in the head” game • But what about real-time vs. other tasks?

Shared memory : dual access from 2 rooms

Shared memory : dual access from 2 rooms

Pipes : Pipes? cut –f 5 –d: /etc/passwd | sort | cut –c 1

Pipes : Pipes? cut –f 5 –d: /etc/passwd | sort | cut –c 1 | sort | uniq –c How many tasks? Small is beautiful.

Mailbox: Similar to pipes but packaged transfer

Mailbox: Similar to pipes but packaged transfer

Questions & Answers Thank you!

Questions & Answers Thank you!