Document information
- University
- Politecnico di Milano
- Degree programme
- Computer Engineering
- Subject
- Advanced Operating Systems
- Academic year
- 2022-2023
- Classification
- Exam · Full exam
- Content
- Exam paper only
- Original format
- Text
- Searchable text
Full exam for Advanced Operating Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Advanced Operating Systems - Part A, January 30th, 2023 Exercises and solutions Exam finalization Question 1.1 This is part A of the AOS’s exam and today you are finalising your entire grade. You must express now how you have finalised part B. The answer is mandatory for the
Full exam for Advanced Operating Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Advanced Operating Systems - Part A, January 30th, 2023 Exercises and solutions Exam finalization Question 1.1 This is part A of the AOS’s exam and today you are finalising your entire grade. You must express now how you have finalised part B. The answer is mandatory for the
Import quality: text was extracted directly from the original document.
Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.
Advanced Operating Systems - Part A, January 30th, 2023 Exercises and solutions Exam finalization Question 1.1 This is part A of the AOS’s exam and today you are finalising your entire grade. You must express now how you have finalised part B. The answer is mandatory for the entire exam. Exercise 2 — Open and closed questions (Points 15) Question 2.1 (Points 5) Describe the following concepts related to locking and synchronization in the Linux kernel. Please use capital letters and respect the space allocated to each class. Solution 1. seq_lock • A seq_lock is a synchronization mechanism in the Linux kernel used to protect data structures that are frequently read but infrequently written. • The lock uses a sequence number to detect conflicting accesses by readers and writers. • When a reader wants to access the shared data structure, it reads the sequence number and stores the value in a local variable (e.g. seq). The reader then checks whether the sequence number has changed, and if it has, the reader repeats the process. 1 do { 2 // V---- loops if seq. counter odd 3 seq = read_seqbegin(&mr_seq_lock); // ^ 4 /* read/copy data here ... | check if seq. counter equal. */ 5 } while (read_seqretry(&mr_seq_lock, seq)); // V • This process is used to ensure that the reader has a consistent view of the shared data structure. • When a writer wants to modify the shared data structure, it first acquires the lock by incrementing the sequence number which signals to any readers that they must start over and obtain a new view of the shared data structure. 1 write_seqlock(&mr_seq_lock); // increment seq. counter 2 /* write lock is obtained... */ 3 write_sequnlock(&mr_seq_lock); // increment seq. counter 2. RCU • Read-copy-update (RCU) is a synchronization mechanism used in computer…
First page of the document.