Back
ExamFull examExam paper only

15 01 2024 E TS

Full exam for Advanced Operating Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Advanced Operating Systems - Part A, Jan 15th, 2024 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

Advanced Operating SystemsFull exam

Document information

What's included in this study material

Full exam for Advanced Operating Systems in the Computer Engineering degree programme at Politecnico di Milano. The document covers: Advanced Operating Systems - Part A, Jan 15th, 2024 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

Import quality: text was extracted directly from the original document.

Extracted content from the 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.

Page 1

Advanced Operating Systems - Part A, Jan 15th, 2024 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) Address the following 3 sub-questions related to concurrency in the Linux kernel. Please USE CAPITAL LETTERS and respect the space allocated to each sub-question. Solution 1. Preemption points. From 2.6, Linux kernel became optionally preemptive. The preemption points are: • At the end of interrupt/exception handling , when TIF_NEED_RESCHED flag in the thread descriptor has been set (forced process switch) • If a task in the kernel explicitly blocks and calls schedule() (planned process switch ). It is however always assumed that the code that explicitly calls schedule() knows it is safe to reschedule. 2. preempt_count. The kernel is keeping track of nested atomic contexts with a process-local preempt_count variable. The kernel bumps up its value whenever it kickstarts an interrupt or grabs a spinlock. Preemption points decrease the variable and check if it’s not zero, which means: “Nope, a context switch isn’t still possible right now.” It’s only once we’ve dealt with our final level of interrupt or released our last spinlock that preemption gets the green light again. 3. The ABA problem. The ABA problem occurs in concurrent programming when a location in memory is read twice, and both reads return the same value, but the value could have changed in between the two reads. Specifically, when using compare-and-swap (CAS) operations, a thread might read a value A, get preempted, and then another thread might change…

Preview

First page of the document.

First page: 15 01 2024 E TS