Operating Systems COP 4600
University of Central Florida
Popular in Course
Popular in Computer Programming
This 53 page Class Notes was uploaded by Luisa Beer on Thursday October 22, 2015. The Class Notes belongs to COP 4600 at University of Central Florida taught by Staff in Fall. Since its upload, it has received 15 views. For similar materials see /class/227475/cop-4600-university-of-central-florida in Computer Programming at University of Central Florida.
Reviews for Operating Systems
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 10/22/15
COP 4600 Summer 2009 Introduction To Operating Systems Security Instructor Dr Mark Llewellyn marklcsucfedu HEC 236 4078232790 httpwwwcsucfeducoursescop4600sum2009 School of Electrical Engineering and Computer Science University of Central Florida COP 4600 Intro To OS Security Page 1 Mark Llewellyn The Security Problem Protection is strictly an internal problem how to control access to programs and data stored in a computer system Security on the other hand requires not only an adequate protection system but also cons1deration of the external enV1ronment in which the computer system operates A protection system is ineffective if user authentication is compromised or a program 1s run by an unauthorlzed user Computer systems must be guarded against unauthorized access malicious destruction or alteration and acc1dental introduction of inconsistency Intruders crackers attempt to breach security A threat is a potential security Violation An attack is attempt to breach security Attacks can be acc1dental or malic10us It is easier to protect against accidental misuse than malicious misuse COP 4600 Intro To OS Security Page 2 Mark Llewellyn 6 The Security Problem cont Computer System Computer System I Sensitive les must be secure Data le security Data Access to the data 0313 must be must be CDlltl Dlled securer transmitted protection through networks network security Guard I 395885 representing users PI39UCESSES representing SETS Guard I Aocess to the computer facili y must be controlled user authentication Users making requests COP 4600 Intro To OS Security Page 3 Mark Llewellyn 6 Types of Threats Interruption Interruption An asset of the system is destroyed or becomes unavailable or unusable Attack on availability Destruction of hardware Cutting of a communication line Disabling the le management system O O Interruption COP 4600 Intro To OS Security Page 4 Mark Llewellyn Types of Threats Interception Interception An unauthorized party gains access to an asset Attack on con dentiality Wiretapping to capture data in a network Illicit copying of les or programs 0 0 Interception COP 4600 Intro To OS Security Page 5 Mark Llewellyn e Types of Threats Modification Modi cation An unauthorized party not only gains access but tampers with an asset Attack on integrity Changing values in a data le Altering a program so that it performs differently Modifying the content of messages being transmitted in a network O 0 Modi cation COP 4600 Intro To OS Security Page 6 Mark Llewellyn 6 Types of Threats Fabrication Fabrication An unauthorized party inserts counterfeit objects into the system Attack on authenticity Insertion of spurious messages in a network Addition of records to a le O 0 Fabrication COP 4600 Intro To OS Security Page 7 Mark Llewellyn e Categories of Attacks Breach of con dentiality involves the unauthorized reading of data or theft of information Typically a breach of con dentiality is the goal of an intruder ie creditcard information theft Breach of integrity involves the unauthorized modi cation of data Such attacks can result in passing of liability to an innocent party or modi cation of the source code of an important commercial application Breach of availability involves the authorized destruction of data Some attackers crackers would rather wreak havoc and gain status or bragging rights than gain nancially Common in website defacement attacks Theft of service involves the unauthorized use of resources For example an intruder or intrusion program may install a daemon on a system that acts like a le server Denial of service DOS involves preventing legitimate use of the system DOS attacks are sometimes accidental The original Internet worm turned into a DOS attack When a bug in the code failed to delay its rapid spread COP 4600 Intro To OS Security Page 8 Mark Llewellyn 6 Methods of Attack Masquerading breach authentication one participant in a communication pretends to be someone else another host or another person Replay attack consists of the malicious or fraudulent repeat of a valid data transmission Sometimes the replay compromises the entire attach ie the repeat of a request to transfer money But frequently it is done along with message modi cation to escalate privileges e g repeat request to transfer money but now into the unauthorized user s account Maninthemiddle attack the attacker sits in the data ow of a communication masquerading as the sender to the receiver and vice versa In a network communication a maninthemiddle attach is often preceded by session hijacking in which an active communication session is intercepted COP 4600 Intro To OS Security Page 9 Mark Llewellyn 6 Normal communication attacker comV U sender receiver attacker Masquerading sender Canon receiver Maninthe middle ID39I Standard Security Attacks l s e n d g r comm Un ba Hon commu czmoi receive r armr kpr COP 4600 Intro To OS Security Page 10 Mark Llewellyn Security Measure Levels Security must occur at four levels to be effective Physical Human Avoid social engineering Phishing A legitimate looking email or web page that misleads a user into entering con dential information Dumpster diving A general term for attempting to gather information in order to gain unauthorized access to a computer by looking through trash nding phone books or notes containing passwords Operating System Network Security is as weak as the weakest link in the chain COP 4600 Intro To OS Security Page 11 Mark Llewellyn 6 Intrusion Techniques Objective of intruder is the gain access to the system or to increase the range of privileges accessible on a system Often the protected information that an intruder acquires is a password Password les can be protected in one of two ways Oneway encryption the system stores only the encrypted form of the user s password Access control access to the password file is limited to one or a very few accounts COP 4600 Intro To OS Security Page 12 Mark Llewellyn 6 Techniques for Learning Passwords Try default password used with standard accounts shipped with system Exhaustively try all short passwords Try words in dictionary or a list of likely passwords Collect information about users and use these items as passwords eg names of children birthdates room numbers etc Try all legitimate license plate numbers for this state Use a Trojan horse to bypass restrictions on access Tap the line between a remote user and the host system COP 4600 Intro To OS Security Page 13 Mark Llewellyn 6 ID Provides Security Determines Whether the user is authorized to gain access to a system Determines the privileges accorded to the user Superuser enables le access protected by the operating system Guest or anonymous accounts have more limited privileges than others ID is used for discretionary access control A user may grant permission to les to others by ID COP 4600 Intro To OS Security Page 14 Mark Llewellyn 6 Password Selection Strategies User generated passwords Users often choose absurdly short passwords which are easy to guess A Purdue University study examined approximately 7000 user accounts on 54 different machines and determined that 3 of the passwords were 3 characters or less in length Users often choose easily guessed passwords Another study examined 14000 encrypted Unix passwords with a guessing program and was able to correctly determine 25 of the passwords Computer generated passwords Users have difficulty remembering them Need to write it down Have history of poor acceptance COP 4600 Intro To OS Security Page 15 Mark Llewellyn 6 Password Selection Strategies Reactive password checking strategy System periodically runs its own password cracker to nd guessable passwords System cancels passwords that are guessed and noti es user Consumes resources to do this Hacker can use this on their own machine with a copy of the password le Proactive password checker The system checks at the time of selection if the password is allowable With guidance from the system users can select memorable passwords that are dif cult to guess COP 4600 Intro To OS Security Page 16 Mark Llewellyn 6 Intrusion Detection Inevitably the best intrusion prevention system will fail A system s second line of defense is intrusion detection and has been the focus of much attention in recent years This interest is motivated by a number of considerations including the following 1 If an intrusion is detected quickly enough the intruder can be identi ed and ejected from the system before any damage is done or any data compromised 2 An effective intrusion detection system can serve as a deterrent acting to prevent intrusions 3 Intrusion detection enables the collection of information about intrusion techniques that can be used to strengthen the intrusion prevention facilities Intrusion detection is based on the assumption that the behavior of the intruder differs from that of a legitimate user COP 4600 Intro To OS Security Page 17 Mark Llewellyn 6 Probability densit W function pro le of A rol39ile or hulhorized uger intruder behavior JEIIaVlDl39 overlap in observed or expected behavior 39 L I I M bl brh 39 average behavior average behavior easura e 2 3mm of intruder of authorized user Parameter Profiles of Behavior of Intruders and Authorized Users COP 4600 Intro To OS Security Page 18 Mark Llewellyn Intrusion Detection Techniques Statistical anomaly detection Collect data related to the behavior of legitimate users over a period of time Statistical tests are used to determine if the observed behavior is not legitimate behavior Con dence levels are set Threshold detection thresholds are defined independent of the user for the frequency of various events Profile based a pro le of the activity of each user is developed an used to detect changes in the behavior of individual accounts COP 4600 Intro To OS Security Page 19 Mark Llewellyn 6 Intrusion Detection Techniques Rulebased detection Anomaly detection rules are developed to detect deviation from previous usage pattern Penetration identi cation an expert system searches for suspicious behavior To summarize statisticalbased approaches attempt to de ne normal or eXpected behavior Whereas rule based approaches attempt to de ne proper behavior COP 4600 Intro To OS Security Page 20 Mark Llewellyn 6 Intrusion Detection cont A fundamental tool for intrusion detection is the audit record Some record of ongoing user activity must be maintained for input into an intrusion detection system Native audit records 0 All operating systems include accounting software that collects information on user activity Detectionspecific audit records 0 Collection facility can be implemented that generates audit records containing only that information required by the intrusion detection system COP 4600 Intro To OS Security Page 21 Mark Llewellyn 6 Malicious Programs Malware Those that need a host program Fragments of programs that cannot exist independently of some application program utility or system program Independent Selfcontained programs that can be scheduled and run by the operating system COP 4600 Intro To OS Security Page 22 Mark Llewellyn 6 Malicious Programs Malware cont Malicious programs Needs host Program Independent I Trapdoor I Logic hombl lTrojauhorseI I Viruss I l Worm I l Zombie I Replicate May also be part ofa virus or worm Taxonomy of Malicious Program COP 4600 Intro To OS Security Page 23 Mark Llewellyn Trapdoor Entry point into a program that allows someone who is aware of trapdoor to gain access Used by programmers to debug and test programs Avoids necessary setup and authentication Method to activate program if something goes wrong with authentication procedure Typically activated via a special sequence of input or is triggered by being run from a certain user ID Remember the movie War Games COP 4600 Intro To OS Security Page 24 Mark Llewellyn 6 Logic Bomb Code embedded in a legitimate program that is set to explode when certain conditions are met Presence or absence of certain les Particular day of the week Particular user running application Once triggered the bomb may alter or delete data or entire les cause a machine to halt or do some other damage Case of Tim Lloyd who was convicted of setting a logic bomb that cost his employer Omega Engineering more than 10 million derailed its corporate growth and eventually led to the layoff of 80 workers He was ultimately convicted sentenced to 41 months in prison and ordered to pay 2 million in restitution COP 4600 Intro To OS Security Page 25 Mark Llewellyn 6 Trojan Horse A useful or apparently useful program that contains hidden code that when invoked performs some unwanted or harmful function Can be used to accomplish functions indirectly that an unauthorized user could not accomplish directly For example it may set file permission so everyone has access to any file Modify a compiler to insert additional code into certain programs as they are compiled such as a system login program The code creates a trap door in the login program that permits the author to log on to the system using a special password COP 4600 Intro To OS Security Page 26 Mark Llewellyn 6 Virus Program that can infect other programs by modifying them the modi cation includes a copy of the Virus program which can then go on to infect other programs Lodged in a host computer a typical Virus takes temporary control of the computer s disk operating system Then whenever the infected computer comes into contact with an uninfected piece of software a fresh copy of the Virus passes into the new program Thus the infection can be spread from computer to computer by unsuspecting users who either swap disks or send programs to one another over a network COP 4600 Intro To OS Security Page 27 Mark Llewellyn e Worms Use network connections to spread from system to system Once active in a system a worm can behave as a Virus or it could implant Trojan horse programs Electronic mail facility A worm mails a copy of itself to other systems Remote execution capability A worm executes a copy of itself on another system Remote login capability A worm logs on to a remote system as a user and then uses commands to copy itself from one system to the other COP 4600 Intro To OS Security Page 28 Mark Llewellyn 6 Zombie Program that secretly takes over another Internet attached computer It uses that computer to launch attacks that are dif cult to trace to the zombie s creator Typically zombies are used in denialof serVice attacks against a targeted website The zombie is planted on hundreds of computers belonging to unsuspecting third parties and then used to overwhelm the target by launching an overwhelming onslaught of traf c COP 4600 Intro To OS Security Page 29 Mark Llewellyn 6 The Nature of Viruses Stages of a virus Dormant phase Virus is idle Not all viruses have this stage Propagation phase Virus places an identical copy of itself into other programs or into certain system areas on the disk Triggering phase Virus is activated to perform the function for which it was intended Caused by a variety of system events Execution phase Function is performed COP 4600 Intro To OS Security Page 30 Mark Llewellyn Types of Viruses Parasitic Attaches itself to executable les and replicates When the infected program is executed it looks for other executables to infect Memoryresident Lodges in main memory as part of a resident system program Once in memory it infects every program that executes COP 4600 Intro To OS Security Page 31 Mark Llewellyn 6 Types of Viruses cont Boot sector Infects boot record Spreads when system is booted from the disk containing the Virus Stealth Speci cally designed to hide itself from detection by antiVirus software May use compression so that the infected program is exactly the same length as an uninfected version COP 4600 Intro To OS Security Page 32 Mark Llewellyn 6 Types of Viruses Polymorphic Creates copies during replication that are functionally equivalent but have distinctly different bit patterns Mutates with every infection making detection by the signature of the Virus impossible Mutation engine creates a random encryption key to encrypt the remainder of the Virus The key is stored with the Virus COP 4600 Intro To OS Security Page 33 Mark Llewellyn 6 2 L Macro Viruses In recent years the number of Viruses encountered at corporate sites has risen dramatically Much of this increase is due to the proliferation of one of the macro Viruses Macro Viruses are particularly threatening for a number of reasons Platform independent Most infect Microsoft Word documents Infect documents not executable portions of code Easily spread Commonly Via email COP 4600 Intro To OS Security Page 34 Mark Llewellyn Macro Viruses cont A macro is an executable program embedded in a word processing document or other type of le Autoexecuting macros in Word Autoexecute Executes when Word is started Automacro Executes When de ned event occurs such as opening or closing a document Command macro Executed when user invokes a command eg File Save COP 4600 Intro To OS Security Page 35 Mark Llewellyn 6 Antivirus Approaches The ideal solution to the threat of viruses is prevention do not allow a virus to get into the system in the rst place This goal is in general impossible to achieve although prevention can reduce the number of successful viral attacks The next best approach is to be able to do the following Detection once the infection has occurred determine that it has occurred an locate the virus Identi cation once detection has been achieved identify the speci c virus that has infected a program Removal once the speci c virus has been identi ed remove all traces of the virus from the infected program and restore it to its original state COP 4600 Intro To OS Security Page 36 Mark Llewellyn 6 Generic Decryption Since a polymorphic Virus is typically encrypted GD technology passes all executable les through a GD scanner Which includes the following elements CPU emulator Instructions in an executable le are interpreted by the emulator rather than the processor Virus signature scanner Scan target code looking for known Virus signatures Emulation control module Controls the execution of the target code COP 4600 Intro To OS Security Page 37 Mark Llewellyn 6 Digital Immune System A comprehensive approach to virus protected developed by IBM Motivation has been the rising threat of Internet based virus propagation Integrated mail systems Mobileprogram system COP 4600 Intro To OS Security Page 38 Mark Llewellyn 6 gt195 Digital Immune System How It Works A monitoring program on each computer uses a variety of heuristics based on system behavior suspicious changes to programs or family signature to infer that a virus may be present The monitoring program forwards a sample copy of any program thought to be infected to an administrative machine The administrative machine encrypts the sample and sends it to a central v1rus analys1s mach1ne This machine creates anenvironment in which the infected program canbe run for analysis The v1rus analys1s machine then produces a prescr1pt10n for identifying and removing the virus The resulting prescription is sent back to the administrative machine The administrative machine forwards the prescription to the infected client The prescription is also forwarded to other clients in the organization Subscribers around the world receive regular antivirus updates that protect COP 4600 Intro To OS Security Page 39 Mark Llewellyn them from the new virus Digital Immune System How It Works cont 1 Virus Infected 3 Virus 3 Ad 39 39 1 r 1 1x353 Client g mlnls m we I 211335 Analyms Machine madlme Machine Private Network Ex ram Signature Derive Prescrip on Ind ivid ual User Network Digital Immune System COP 4600 Intro To OS Security Page 40 Mark Llewellyn 6 Email Virus Activated when recipient opens the email attachment Activated by opening an email that contains the Virus Uses Visual Basic scripting language Propagates itself to all of the email addresses known to the infected host COP 4600 Intro To OS Security Page 41 Mark Llewellyn 6 COP 4600 Sec 1 Operating Systems Lecture 11 instructor Joohari Lee iieecs ucfedu nttp WWW cs ucf eduiieecop4600 cnooi of Computer Sc ence University of Central Florida comet 09mm systems Joana Lee Chapter 6 Concurrent Programming Outline 61 Introduction 62 itors 621 Condition Variables 622 Simple Resource Allocation with Monitors 623 Monitor Example Circular Buffer 624 Monitor Example Readers and Writers 63 Java Monitors 64 Java Multithreading Case Study Part III ProducerConsumer Relationship in Java 65 Java Multithreading Case Study Part IV Circular Buffer in Java combat 09mm systems Joana Lee Objectives A er reading this chapter you should understand 7 how monitors synchronize access to data 7 how condition variables are used Witn monitors 7 solutions rorciassic problems in concurrent programming sucn as readers and writers and circuiarpurrer 7 remote procedure caiis combat 09mm systems Joana Lee 621 Introduction Recent interest in concurrent programming languages 7 Naturally express solutions to inherently parallel problems 7 Due to proliferation ofmultiprocessing systems distributed systems and massive y parallel architectures 7 More complex than standard programs More time required tn ertE test and debug Semaphore Peterson s Does Semaphore provide an appropriate solution to the critical section problem What would be the drawbacks if any of Semaphore Is there other better way than Semaphore ls Semaphore better than previous solutions like cometquot 09mm systems Joana Lee Producer Process Consumer Process do r do i Waitfull produce an item m nextp Waitmutex wardemptyt remove an item from buffer to nextc signammutext add nextp to buffer signalempty signammutext consumeme item m nextc Recall prr duoeroonsumerprooiem Use three semaphores Producer Process Consumer Process d Possible deadlock oi l Vvheri the bufferis full 9 Waitfull produce an item in nextp remove an item from buffer to nextc Signammutex add nextp to buffer Signalempty signalmutex ignalfull lie 1 consume the item in nextc s Wh While 1 comm 09mm System Joana Lee Semaphore semaphore semaphore With semaphore IPC and synchronization looks easy How care Jl we must be when using semaphore Tanenbaum said It is like programming in assembly language only worse because the errors are race conditions deadlocks and other forms of unpredictable and irreproducible behaviorquot combat 09mm System Joana Lee More problems with Semaphores 7 Use of semaphores to avoid confusion in dealing with process synchronization We still have timing errors and possible starvation Slgl ial mutex Wait m utex Wait m utex criticalisectiori criticalisection criticalisection Wait mutex Wait mutex Slgl ial mutex Mutual exclusion Deadlock Both combat 09mm System Joana Lee Motivation Semaphores and Events are e Powerrui out iovvrievei abstractions Programming Witn tnern is nigniy errorprone n n iin nrtrn int in 7 Not usaoie iri distributed memory systems Need higherlevel primitives res orrnessages comm Okrmngsysmms Monitors ornakeite s T a ier Hoare i974 and orincn Hansen taro proposed a higher ievei synchronization primitive caiieo monitor Monitor 7 Acoiiection otproceoures variabies ano data stroctorestnat are aii grouped togetner in a speciai kind oirnoooie or package 7 Foiiowprincipies oi abstract oatatype obiectrorienteo 62 Monitors Monitor 7 Contains data and procedures neeoeoto aiiocate snared resources Accessioie oninitnin tne rnonitor No Waytortnreaos outsioe rnonitorto access rnonitoroata Resource aiiocation usin monitors 7 Thread rnust aii monitor Entry routine 7 Mutuai exciusion is rigioiy entorceo at rnonitor boundary aneaos returri resources through monitors as WEH e Montorentryrootine caiissiono e s onewaning tnreao to acquire resource and enter rnon e HignerpriornygiventoWaitingtnreaostnan onesnewiyarriveo Avoids inoeiinite postponement Monitors Highcievei Synchronization construct tnat allows tne sare snanng or an abstract data type among concurrent processes In itor monitorname shared variable declarations procedure body P7 procedure body P2 procedure body Pn initiaiization code Monitors Monitor is a programming language construct 7 ts up to tne cornpiierto irnpiernenttne rnutuai exclusion on rnonitor entries using binary sernapnores in generai e The compiler not tne programmer arranges rortne rnutuai exclusion gt iess errorprone Implementation must guarantee Resource accessioie ony by rnonitor procedures Monitor procedures are mutually exclusive rAt anytime only one process may be executing a procedure Witnin a given rnonitor 7 Only one process thread may be inside a monitor at a time NA comet 09mm systems Joana Lee Condition Variables ls mutual exclusion enough for our requirements 7 ex lri produce rnerprobiern What irtne ourreris full and tne producernas to block 7 exwhat irtne ourreris empty and tne consurnernas to block It does not provide any means for processes to municate or synchronize with one another 7 inside tne monitor use a conditiona valiabe Introducing condition variables i wait amp signai operations on tne conditionai variables 7 A process inside tne rnonitor can block on tne condition variables and allow anotnerprocess to entertne rnonitor comatm 09mm systems Joana Lee Condition Variables For coordination monitors provide cwait Calling process is blocllted and placed on waiting queue associated witn condition yariable c csignal Calling process wakes up tne first process on cqueue Wnen no process is Waltll lg signal is lost condition variablequot c is not a conventional variable c nas no yalue c is an arbitrary narne cnosen by prograrnrnerto designate an eyenti state orcondition Eacn c nas a waiting queue associated A process may block ltself Ol l c an lt Walls Lll ltll another process issues a sgnaon c Conditional Variables When signal is called 7 Two processes eligible to be inside tne rnonitor ltne process calling tne signal 2 anotnerprocess tnat waits on tne conditional yanable 7 Only one can be executing inside tne rnonitor What should happen after a SIGNAL operation Hoare s approach Signalandcontinue monitor Hansen s approach Signalandexit monitor cometquot 09mm systems Joana Lee 621 Condition Variables Signalandexit monitor by Hansen 7 Before a tnread can reenter tne rnol39lltolquot tne tnread calling si gnal rnust rirst exit rnonitor e Requires tnread to exit tne rnonitorirnrnediately upon signaling Signalandcontinue monitor by Hoare e Allows tnread inside rnonitorto signal tnat tne rnonitorwill soon becorne ayailable 7 still rnaintain locllt on tne rnonitoruntil tnread exits rnon tor 7 Thread can exit rnonitor by waiting on a condition yanable orby cornpleting execution orcode protected by rnonitor cometquot 09mm systems Joana Lee pr callsJ Hoare s Semantics Monitor Munitur Prncedurefr Procedure JO u xlt m irhlnckuil ijUJiH t39 wail rr X lt o JiJmimwwml 1mm Ur pomw Procedure m Pmredurc g g Effect of wait commit o Waxing Systems r Hoare s Semantics Mrmnu Murmur rumaura u l t uuilu 39 ymmno K39Jgrhmm 439 l39rrxulmc m l hutmun l r w v u pnmr w mu Effect of signal comm Opera gSyslems Hoare s Semantics a cwait W gt csignal0 ll p2 blocks ll p1 resumes exito ll p2 resumes exito Monitor Let the newly awakened process run suspending the p rocessthat called sIgna n u is given a soon monitor comm Opera gSyslems Hansen s Semantics L1 0 Wat 1 ptoeks c mgnaK em p2 contmues p2 mshes p resumes Momtor e A process domg a SKSNAL must exttthe momtortmmedtatety e GNAL can appear omy as the Ma statement to a mom ewto s procedu e Conceptuauystmpterand easterto trnpternent Bounded buffer problem char buffern 0 nextout0 fullCount0 notfull int nextin condition notempty depositchar data remove char data combat 0993mm systems Bounded buffer problem itchar data tn data depos 39 fullCoun buffernextin nextin next1n1 a n fullCount funcdunt1 ovechar data o tout r39 n rem if fullCount buffernex nexto t fullCount notfull sinal I 1 some 0993mm systems JoMatLee Conditional Variables Walt eh E dltl variable vs Walt eh serhaphere e Cehuitieh variables ue het aeeurhuiate Signals fur iater use the Way serhapheres an e if a E dltl variable is signaled With he ehe Waiting fur iii the Signal is lust 622 Simple Resource Allocation with anuthertnread perfurms ari aetieri l SldE rheriiter Meriiter asseeiates separate eeriuitieri variable With distinct situatieri that rhight eause thread te Wait Evevy eehuitieh vaiiable has an asseeiateu queue 622 Simple Resource Allocation with onI ors Flgure 61 Simple reseuree aiieeatiehwnh a manner in pseuueeeue 623 Monitor Example Circular Buffer ircular buffer implementatiun ufthe SEIlutiEIri m c pruducErcunsumer prubl er depusils dale in successive eiemema ulanay depusned 7 Pvuducev can be several items ahead ulcunsumev 7 We pmduceviills las1 eiemem eianay ll mus1 wvap around and begin depusning dale m 012 m eiemem eianay 623 Monitor Example Circular Buffer Due in the fixed size Ufa circularbuffer 7 Pvuduc illuccasiunallylindallanayelemenlsmllinwhich easeme pmducev mus1wail unlil cunsumev Emplies an away eiemem 7 Cunsumevwill uccasiunall which ease We consumer an ana eiemem We all away eiemems empiy in mus1wan until pmducev eepeaia dale 623 Monitor Example Circular Buffer Figure 52 Mamm pseueaeaee implementation ma circular muev Pan 1 m2 623 Monitor Example Circular Buffer mm 52 may mamas mman m am pm 2 am i Mmm MW rr 624 Monitor Example Readers and Writers Readers 7 Read uaia but an not change cunlems uldala s Muiiipis readers can accessms shaved dale ai mice in ll m proceed as lung as nu thread isziling and nu inlEHhand l5 vile Wailinglu W in signallhe next Waning ieadevlu mama causing a chain reaction mum dale a Musl have exclusive access 624 Monitor Example Readers and Fl ers mm 51 Mamm Pseudamde my mlvmg We readers and vwilevs Problem Pan 1 m a J 624 Monitor Example Readers and ers mm s 3 Manna pseudacade Wm m m m Wms mm m2 m3 624 Monitor Example Readers and Writers mm s 3 Manna pseudacade Wm m m m Wms mm ma 0V3