CPS110: Address translationCourse administrationSlide 3Slide 4Slide 5Midterm examAnalysis vs synthesisHow to studySyntax for programsSyntax for tracesOn-board reviewCPS110: Address translationLandon CoxFebruary 18, 2009Course administrationProject 1 drawing to a closeTwo groups with 100% (another is close)Four groups > 60 on 1tMany others close (40-50 range)Some final tips …Course administrationWhat to carefully rereadSection 4.4 of the spec (ordering stuff)Thread implementation slidesLock implementation slidesI see a lot of code that ignore these sourcesOther hints …Course administration /* * Allocate space for thread control block and * new stack. */ try { thread_ptr = new thread_t; thread_ptr->stack = NULL; thread_ptr->stack = new char [stack_size]; } catch(bad_alloc) { if (thread_ptr != NULL) { if (thread_ptr->stack != NULL) { delete [] thread_ptr->stack; } delete thread_ptr; } return(-1); }Course administrationProject 2 (virtual memory) out next WednesdayIn some ways easier than P1In some ways harder than P1 (not given a solution)Next deadline: midterm exam (February 23rd)In-classOne sheet (two sides) of notesNo laptops or other electronic resourcesPractice exam in discussion section this weekMidterm examWhat will be covered?All threads/concurrency materialProject 1LecturesHomework problemsAnalysis vs synthesisNo regurgitation questionsAnalysis questionsAnalyze system/program/designTrace through programCompute performanceDetermine properties (deadlock, starvation, races)SynthesisDesign/construct a new system/program/designI like these more (e.g. learn the most doing projects)How to studyDo homework problemsUnderstand Project 1In groupsCreate and answer questions I might ask(you might get lucky; happened in past)Syntax for programsReal or pseudo is fine (just be clear)STL is finequeue.{push, pop, front, empty}MonitorsProject 1 syntax or OO syntaxthread_lock (lock_num) or mutex.lock ()SemaphoresOO syntaxsem1.up (), sem1.down (), sem2.up (), …There is no “getVal” call!Remember to specify initial value!!Syntax for tracesThread: line number (or range of lines)1: checkMilk () {2: if (noNote) {3: leave note4: if (noMilk){5: buy milk;6: }7: remove note;8: }9: }Landon: 1-2Melissa: 1-2Landon: 3-6Melissa: 3-6On-board
View Full Document