PROJET AUTOBLOG


Shaarli - Les petits liens d'Alda

Site original : Shaarli - Les petits liens d'Alda

⇐ retour index

Best analogy for user and kernel space?

mercredi 9 avril 2014 à 11:36
« You are a teacher taking a group of schoolchildren to the local library.
You're all in the library, sitting around a table.

You are the Kernel.
You have a notebook that you can write things in (your cache).
The children are userspace.
The table is RAM.
The bookshelves are permanent disk storage.

If a child wants to read a book, he asks your permission.
You look up the books location from the library records.
You: "Yes you can read the book. The book is located here. Go fetch it."
You note this is a popular book, so note the location in your notebook for faster response.
The child toddles off and fetches the book.
Child: "I have the book. Can I have some table-space so I can sit down and read it."
You: "I'll clear some space and assign it to you. There you go."
Time passes. Another child has a book to read, but no space to sit down.
You: "Child #1, you're taking too long, Take your book and stand over there for 5 minutes while others use your table-space."
and so forth. »
(Permalink)