← Indietro
EsameEsame completoTesto d’esame

30 01 2023 E TS

Esame completo di Advanced Operating Systems per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Advanced Operating SystemsEsame completo

Informazioni sul documento

Cosa trovi in questo materiale

Esame completo di Advanced Operating Systems per il corso di Computer Engineering presso Politecnico di Milano. Materiale proveniente dall’archivio storico Studwiz e classificato per la consultazione online.

Qualità dell’importazione: il testo è stato estratto direttamente dal documento originale.

Contenuti estratti dal documento

Passaggi rappresentativi riconosciuti nelle diverse parti del materiale. Il testo completo resta presente nella pagina per la ricerca, mentre l’anteprima compatta rende più semplice la lettura.

Pagina 1

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…

Anteprima

Prima pagina del documento.

Prima pagina: 30 01 2023 E TS