Download presentation
Presentation is loading. Please wait.
Published byDarlene Anastasia Oliver Modified over 8 years ago
1
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM
2
Last time: Heterogeneity; little-endian and big-endian representation Timing, response time. Trusted intermediaries Case study the X11 system. Peer-to-peer systems Remote Procedure Calls Today: Presentation of the RPC paper by Birell. Domain Name Service (DNS) NFS (Network File System) Virtualization: Threads, Virtual memory, Bounded buffers. Virtual Links Next time Thread coordination with a bounded buffer Race conditions Lecture 13 – Tuesday October 5, 2010 Lecture 132
3
3 DNS Dictionary Domain name an identification label that defines a realm of administrative autonomy, authority, or control in the Internet, based on the Domain Name System. The top-level domains (TLDs) are the highest level of domain names of the Internet; they form the DNS root zone. There are 20 generic top-level domains and 248 country code top-level domains Authoritative name server gives original, first-hand, definitive answers; holds either the name record or a referral record for the name Authoritative record first hand information about a host name Naming authority an Internet administrative authority allowed to add authoritative records to a name server Referral record binds a hierarchical region of the DNS name space to another server that could help resolve the name Recursive name service a DNS server takes upon itself to resolve a name rather than provide a referral record. Idempotent action action that can be interrupted and restarted from the beginning any number of times and still produce the same result as if the action had run to completion without interruption Lecture 13
4
4 How DNS works A client sends a request to resolve a name to a Domain Name server The server examines the collection of the domains it is responsible for If it finds the name record it returns the record Else it searches a set of referral records Starts with the most significant component of the requested domain name for the one that matches the most components and If found it returns the name record Else returns “not found” Example on the next slide (left diagram): the system ginger.cs.pedantic.edu tries to resolve the name ginger.Scholarly.edu Important each host must have the address of a domain name server when it is connected to the Internet. This address could be : provided by the ISP (Internet Service Provider) hardwired into the browser generated when the system was installed selected by the user Lecture 13 4
5
5 5
6
Why file handles and not path names --------------------------------- Example 1 ------------------------------------------------ Program 1 on client 1 Program 2 on client 2 CHDIR (‘dir1’) fd OPEN(“f”, READONLY) RENAME(‘dir1’,’dir2) RENAME(‘dir3’,’dir1’) READ(fd,buf,n) To follow the UNIX specification if both clients would be on the same system client1 would read from dir2.f. If the inode number allows the client 1 to follw the same semantics rather than read from dir1/f ----------------------------------- Example 2 ----------------------------------------------- fd OPEN(“file1”, READONLY) UNLINK(“f”) fd OPEN(“f”,CREATE) READ(fd,buf,n) If the NFS server reuses the inode of the old file then the RPC from client 2 will read from the new file created by client 1. The generation number allows the NSF server to distinguish between the old file opened by client 2 and the new one created by client 1. Lecture 13 6
7
7
8
8
9
Virtualization – relating physical with virtual objects Virtualization simulating the interface to a physical object by: 1. Multiplexing create multiple physical objects from one instance of a physical object. 2. Aggregation create one virtual object from multiple physical objects 3. Emulation construct a virtual object from a different type of a physical object. Emulation in software is slow. MethodPhysical Resource Virtual Resource Multiplexingprocessorthread real memoryvirtual memory communication channelvirtual circuit processorserver (e.g., Web server) AggregationdiskRAID coremulti-core processor EmulationdiskRAM disk system (e.g. Macintosh)virtual machine (e.g., Virtual PC) Multiplexing + Emulation real memory + diskvirtual memory with paging communication channel + processor TCP protocol 9Lecture 13
10
Thread coordination with a bounded buffer Producer-consumer problem coordinate the sending and receiving threads Basic assumptions: We have only two threads Threads proceed concurrently at independent speeds/rates Bounded buffer – only N buffer cells Messages are of fixed size and occupy only one buffer cell Spin lock a thread keeps checking a control variable/semaphore “until the light turns green” 10Lecture 13
11
11Lecture 13
12
12Lecture 13
13
13Lecture 13
14
14Lecture 13
15
Deadlocks Deadlocks prevent sets of concurrent threads/processes from completing their tasks. How does a deadlock occur a set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set. Example semaphores A and B, initialized to 1 P 0 P 1 wait (A);wait(B) wait (B);wait(A) Aim prevent or avoid deadlocks 15Lecture 13
16
Example of a deadlock Traffic only in one direction. Solution one car backs up (preempt resources and rollback). Several cars may have to be backed up. Starvation is possible. 16Lecture 13
17
Simultaneous conditions for deadlock Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption: a resource can be released only voluntarily by the process holding it (presumably after that process has finished). Circular wait: there exists a set {P 0, P 1, …, P 0 } of waiting processes such that P 0 is waiting for a resource that is held by P 1, P 1 is waiting for a resource that is held by P 2, …, P n–1 is waiting for a resource that is held by P n, and P 0 is waiting for a resource that is held by P 0. 17Lecture 13
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.