DOC PREVIEW
Berkeley COMPSCI 162 - Lecture 8 Tips for Working in a Project Team/ Cooperating Processes and Deadlock

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Page 1CS162Operating Systems andSystems ProgrammingLecture 8Tips for Working in a Project Team/ Cooperating Processes and DeadlockFebruary 20, 2008Prof. Anthony D. Josephhttp://inst.eecs.berkeley.edu/~cs162Lec 8.22/20/08 Joseph CS162 ©UCB Spring 2008Goals for Today• Tips for Programming in a Project Team• Discussion of Deadlocks– Conditions for its occurrence– Solutions for breaking and avoiding deadlockNote: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne Note: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated from my lecture notes by Kubiatowicz.Lec 8.32/20/08 Joseph CS162 ©UCB Spring 2008Tips for Programming in a Project Team• Big projects require more than one person (or long, long, long time)– Big OS: thousands of person-years!• It’s very hard to make software project teams work correctly– Doesn’t seem to be as true of big construction projects» Empire state building finished in one year: staging iron production thousands of miles away» Or the Hoover dam: built towns to hold workers– Is it OK to miss deadlines? » We make it free (slip days)» Reality: they’re very expensive as time-to-market is one of the most important things!―You just have to get your synchronization right!‖Lec 8.42/20/08 Joseph CS162 ©UCB Spring 2008Big Projects• What is a big project?– Time/work estimation is hard– Programmers are eternal optimistics (it will only take two days)!» This is why we bug you about starting the project early» Had a grad student who used to say he just needed ―10 minutes‖ to fix something. Two hours later…• Can a project be efficiently partitioned?– Partitionable task decreases in time asyou add people– But, if you require communication:» Time reaches a minimum bound» With complex interactions, time increases!– Mythical person-month problem:» You estimate how long a project will take» Starts to fall behind, so you add more people» Project takes even more time!Page 2Lec 8.52/20/08 Joseph CS162 ©UCB Spring 2008Techniques for Partitioning Tasks• Functional– Person A implements threads, Person B implements semaphores, Person C implements locks…– Problem: Lots of communication across APIs» If B changes the API, A may need to make changes» Story: Large airline company spent $200 million on a new scheduling and booking system. Two teams ―working together.‖ After two years, went to merge software. Failed! Interfaces had changed (documented, but no one noticed). Result: would cost another $200 million to fix. • Task– Person A designs, Person B writes code, Person C tests– May be difficult to find right balance, but can focus on each person’s strengths (Theory vs systems hacker)– Since Debugging is hard, Microsoft has twotesters for eachprogrammer• Most CS162 project teams are functional, but people have had success with task-based divisionsLec 8.62/20/08 Joseph CS162 ©UCB Spring 2008Defensive Programming• Like defensive driving, but for code: – Avoid depending on others, so that if they do something unexpected, you won’t crash – survive unexpected behavior• Software engineering focuses on functionality:– Given correct inputs, code produces useful/correct outputs• Security cares about what happens when program is given invalid or unexpected inputs:– Shouldn’t crash, cause undesirable side-effects, or produce dangerous outputs for bad inputs• Defensive programming– Apply idea at every interface or security perimeter» So each module remains robust even if all others misbehave• General strategy– Assume attacker controls module’s inputs, make sure nothing terrible happensLec 8.72/20/08 Joseph CS162 ©UCB Spring 2008Communication• More people mean more communication– Changes have to be propagated to more people– Think about person writing code for most fundamental component of system: everyone depends on them!• Miscommunication is common– ―Index starts at 0? I thought you said 1!‖• Who makes decisions?– Individual decisions are fast but trouble– Group decisions take time– Centralized decisions require a big picture view (someone who can be the ―system architect‖)• Often designating someone as the system architect can be a good thing– Better not be clueless– Better have good people skills– Better let other people do work Lec 8.82/20/08 Joseph CS162 ©UCB Spring 2008Coordination• More people  no one can make all meetings!– They miss decisions and associated discussion– Example from earlier class: one person missed meetings and did something group had rejected– Why do we limit groups to 5 people? » You would never be able to schedule meetings otherwise– Why do we require 4 people minimum?» You need to experience groups to get ready for real world• People have different work styles– Some people work in the morning, some at night– How do you decide when to meet or work together?• What about project slippage?– It will happen, guaranteed!– Ex: phase 4, everyone busy but not talking. One person way behind. No one knew until very end – too late!• Hard to add people to existing group– Members have already figured out how to work togetherPage 3Lec 8.92/20/08 Joseph CS162 ©UCB Spring 2008How to Make it Work?• People are human. Get over it.– People will make mistakes, miss meetings, miss deadlines, etc. You need to live with it and adapt– It is better to anticipate problems than clean up afterwards. • Document, document, document– Why Document?» Expose decisions and communicate to others» Easier to spot mistakes early» Easier to estimate progress– What to document?» Everything (but don’t overwhelm people or no one will read)– Standardize!» One programming format: variable naming conventions, tab indents,etc.» Comments (Requires, effects, modifies)—javadoc?Lec 8.102/20/08 Joseph CS162 ©UCB Spring 2008Suggested Documents for You to Maintain• Project objectives: goals, constraints, and priorities• Specifications: the manual plus performance specs– This should be the first document generated and the last one finished• Meeting notes– Document all decisions– You can often cut & paste for the design documents• Schedule: What is your anticipated timing?– This document is critical!• Organizational Chart– Who is responsible for what task?Lec


View Full Document

Berkeley COMPSCI 162 - Lecture 8 Tips for Working in a Project Team/ Cooperating Processes and Deadlock

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Download Lecture 8 Tips for Working in a Project Team/ Cooperating Processes and Deadlock
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 8 Tips for Working in a Project Team/ Cooperating Processes and Deadlock and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 8 Tips for Working in a Project Team/ Cooperating Processes and Deadlock 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?