Compiler Construction | Information Retrieval | Introduction to Programming | Operating Systems | Home

Content updated first on; should propagate to the mirror at ISI every hour.

Information Retrieval

Operating Systems

Google Group for the course (announcements, etc.)

Notes / slides

The material in the slides is a proper subset of the material in the notes.



Project ideas    Suggested topics for presentations

Thanks to Ansuman Banerjee and Arindam Pal for suggestions.

Question papers from earlier years

Feedback welcome (please send email to my first name dot my last name at gmail etc.).

Mid-sem exams:  2022    2018    2017    2016    2015    2014    2012    2011    2010   

End-sem exams:  2022    2018    2017    2016    2015    2014    2012    2011    2010   

Supplementary Reading

Bootstrapping process   (locally stored pdf) (Thanks to Arindam Pal, MTCS 2013-2015, for detecting and repairing broken links.)
Lamport's Bakery algorithm   (local copy)
Starvation-free solution to the Readers-Writers Problem
White Paper on SunOS 5.0 Multithread Architecture
Virtual memory in Linux   (local copy of older version)
Memory Management in Linux

Odds and Ends

Program to demonstrate sharing of stdin between parent and child

What is scheduled first after a fork?
According to Section 3.2.3 (Process Scheduling) from "Advanced Linux programming" (Mark Mitchell, Jeffrey Oldham, Alex Samuel, Sams Publishing, 2001):

Linux schedules the parent and child process independently; there's no guarantee of which one will run first, or how long it will run before Linux interrupts it and lets the other process (or some other process on the system) run.

However, the following passage from Section of "Understanding the Linux Kernel, 3rd Edition" (Daniel P. Bovet, Marco Cesati, O'Reilly, 2005) is more up-to-date and sounds much more convincing:

If the child will run on the same CPU as the parent, and parent and child do not share the same set of page tables (CLONE_VM flag cleared), it then forces the child to run before the parent by inserting it into the parent's runqueue right before the parent. This simple step yields better performance if the child flushes its address space and executes a new program right after the forking. If we let the parent run first, the Copy On Write mechanism would give rise to a series of unnecessary page duplications. Otherwise, if the child will not be run on the same CPU as the parent, or if parent and child share the same set of page tables (CLONE_VM flag set), it inserts the child in the last position of the parent's runqueue.

stat x/y/z/abc.txt
editor x/y/z/abc.txt 
rm x/y/z/abc.txt OR rm -rf x
/* save x/y/z/abc.txt in editor */
stat x/y/z/abc.txt

A History of Unix

Automata, Languages and Computation

Compiler Construction

Last modified: Sun Apr 28 12:13:30 IST 2024