PPT-CS 140 Lecture Notes: Lock Implementation
Author : yoshiko-marsland | Published Date : 2016-11-14
Slide 1 Uniprocessor Locks void lockacquire struct lock l intrdisable if lgtlocked lgtlocked 1 else queueadd amplgtq
Presentation Embed Code
Download Presentation
Download Presentation The PPT/PDF document "CS 140 Lecture Notes: Lock Implementatio..." is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
CS 140 Lecture Notes: Lock Implementation: Transcript
Slide 1 Uniprocessor Locks void lockacquire struct lock l intrdisable if lgtlocked lgtlocked 1 else queueadd amplgtq . Slide . 1. <p> Sample <b>bold</b> display</p>. P. B. #text. #text. nextSibling. prevSibling. nextSibling. prevSibling. firstChild. lastChild. parentNode. parentNode. parentNode. Slide . 1. <. p>Sample . <b>bold</b> display</p>. P. B. #text. #text. nextSibling. prevSibling. nextSibling. prevSibling. firstChild. lastChild. parentNode. parentNode. parentNode. Slide . 1. Too Much Milk With Locks. Both threads:. struct. lock l;. .... l. ock_acquire. (&l);. if (milk == 0) . {. . . buy_milk. ();. }. lock_release. (&. l);. CS 140 Lecture Notes: Locks. Slide . 1. Too Much Milk With Locks. Both threads:. struct. lock l;. .... l. ock_acquire. (&l);. if (milk == 0) . {. . . buyMilk. ();. }. lock_release. (&. l);. CS 140 Lecture Notes: Locks. Slide . 1. Uniprocessor . Locks. void . lock_acquire. (. struct. lock *l) {. . intr_disable. ();. if (!l->locked) {. l->locked = 1;. } else {. . queue_add. (&l->q, . Slide . 1. Uniprocessor . Locks. void . lock_acquire. (. struct. lock *l) {. . intr_disable. ();. if (!l->locked) {. l->locked = 1;. } else {. . queue_add. (&l->q, . Slide . 1. <. p>Sample . <b>bold</b> display</p>. P. B. #text. #text. nextSibling. prevSibling. nextSibling. prevSibling. firstChild. lastChild. parentNode. parentNode. parentNode. Slide . 1. CSS Rule. body {. font-family: Tahoma, Arial, sans-serif;. color: black;. background: white;. margin: 8px;. }. Selector. Declaration. Block. Attribute Name. Value. CS 142 Lecture Notes: CSS. Slide . 1. <p> Sample <b>bold</b> display</p>. P. B. #text. #text. nextSibling. prevSibling. nextSibling. prevSibling. firstChild. lastChild. parentNode. parentNode. parentNode. Slide . 1. CSS Rule. body {. font-family: Tahoma, Arial, sans-serif;. color: black;. background: white;. margin: 8px;. }. Selector. Declaration. Block. Attribute Name. Value. CS 142 Lecture Notes: CSS. Slide . 1. Google Datacenter. CS 142 Lecture Notes: Datacenters. Slide . 2. Datacenter Organization. Rack:. 50 machines. DRAM: 200-800GB @ 300 . µs. Disk: 100TB @ 10ms. Single server:. 4-8 cores. DRAM: 4-16GB @ 100ns. Slide . 1. Basic Ruby Syntax. sum = 0. i. = 1. while. . i. <= 10 . do. sum += . i. *. i. . i. = . i. + 1. end. puts "Sum of squares is #{sum}\n". Newline is statement separator. do ... end. Slide . 1. Too Much Milk With Locks. Both threads:. struct. lock l;. .... l. ock_acquire. (&l);. if (milk == 0) . {. . . buyMilk. ();. }. lock_release. (&. l);. CS 140 Lecture Notes: Locks. class Lock {. Lock() {}. int locked = 0;. . ThreadQueue. q;. };. void Lock::lock() {. . intrDisable. ();. if (!locked) {. locked = 1;. } else {. . q.add. (. currentThread.
Download Document
Here is the link to download the presentation.
"CS 140 Lecture Notes: Lock Implementation"The content belongs to its owner. You may download and print it for personal use, without modification, and keep all copyright notices. By downloading, you agree to these terms.
Related Documents