59
Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4

Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Embed Size (px)

Citation preview

Page 1: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Naming

•Chapter 4

Page 2: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advertisment!!

• Please inform the students to subscribe to the mailing list by sending an email to

[email protected]

containing the line:

subscribe

Regards,

--Shahriari

Page 3: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Naming• Role of naming: share resources, uniquely identify

entities, refer to locations, …

• Resolution of names: naming system

• Often the naming system is distributed across multiple machines.

• In this chapter:– Organization and implementation of human-friendly

names– Using names to locate mobile entities: mobile telephony.– Removed and unreferenced objects and names.

Page 4: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Naming-2

• Subject of name: resources such as hosts, files, ..– Processes, users, mailboxes, messages, connections,..

• To operate on an entity, we need an access point.

• The name of an access point is called “address”

• Location independency.

• Identifier: refers to at most one entity and each entity is referred to by at most one identifier, and never reused.

• Name space

Page 5: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Name Spaces (1)

• A general naming graph with a single root node.

Page 6: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Name Spaces (2)

• The general organization of the UNIX file system implementation on a logical disk of contiguous disk blocks.

Page 7: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Name Resolution

• The process of looking up a name: Name Resolution• Depends on if we know the start point, e.g. first

inode.• Closure Mechanism: knowing how and where to

start name resolution.• Environment variable (“HOME”) helps.• Aliases• Hard Link• Symbolic link (shortcut)

Page 8: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Linking and Mounting (1)

• The concept of a symbolic link explained in a naming graph.

Page 9: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Linking and Mounting (2)• Mounting remote name spaces through a

specific process protocol.

Page 10: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Linking and Mounting (3)• Mounting is one way to merge different name spaces

• Organization of the DEC Global Name Service: Adding a new root, so existing names should be changed! So names should have their initiating point; no:/home/steen/keys

Page 11: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Implementation of a Name Space

• Name space is the heart of a naming service.

• In LANs, it is feasible to implement a naming service through a single name server.

• In large-scale distributed systems, we need to distribute the implementation of a name space over multiple name servers.

• It is normally implemented hierarchically.

Page 12: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Name Space Distribution (1)

• An example partitioning of the DNS name space, including Internet-accessible files, into three layers.

Page 13: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Name Space Distribution (2)

• A comparison between name servers for implementing nodes from a large-scale name space partitioned into a global layer, as an administrational layer, and a managerial layer.

Item Global Administrational Managerial

Geographical scale of network Worldwide Organization Department

Total number of nodes Few Many Vast numbers

Responsiveness to lookups Seconds Milliseconds Immediate

Update propagation Lazy Immediate Immediate

Number of replicas Many None or few None

Is client-side caching applied? Yes Yes Sometimes

Page 14: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Implementation of Name Resolution (1)• The principle of iterative name resolution. In each step, the

address of the name server for the remaining part is given.

Page 15: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Implementation of Name Resolution (2)• The principle of recursive name resolution.

• Caching is more efficient here compared to the iterative.

Page 16: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Implementation of Name Resolution (3)

• Recursive name resolution of <nl, vu, cs, ftp>. Name servers cache intermediate results for subsequent lookups.

Server for node

Should resolve

Looks upPasses to child

Receives and caches

Returns to requester

cs <ftp> #<ftp> -- -- #<ftp>

vu <cs,ftp> #<cs> <ftp> #<ftp> #<cs>#<cs, ftp>

ni <vu,cs,ftp> #<vu> <cs,ftp> #<cs>#<cs,ftp>

#<vu>#<vu,cs>#<vu,cs,ftp>

root <ni,vu,cs,ftp> #<nl> <vu,cs,ftp> #<vu>#<vu,cs>#<vu,cs,ftp>

#<nl>#<nl,vu>#<nl,vu,cs>#<nl,vu,cs,ftp>

Page 17: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Implementation of Name Resolution (4)

• The comparison between recursive and iterative name resolution with respect to communication costs.

Page 18: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Example: DNS

• One of the largest name service.• Organization is a rooted tree hierarchy.• Label has a max of 63 alphanumeric chars; Path

is restricted to 256 chars.• Representation of the path name,

root:<ir,sharif,ce,cabinet> as “cabinet.ce.sharif.ir.” The rightmost “.” is normally ommited.

• Incoming edge has the same name as the node• A subtree is called a domain.; a path name to its

root is called a domain name.

Page 19: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

The DNS Name Space• The most important types of resource records forming

the contents of nodes in the DNS name space.

Type of recordAssociated entity

Description

SOA (Start of Authority) Zone Holds information on the represented zone

A (Address) Host Contains an IP address of the host this node represents

MX (Mail Exchange) Domain Refers to a mail server to handle mail addressed to this node

SRV (Server) Domain Refers to a server handling a specific service

NS (Name Service) Zone Refers to a name server that implements the represented zone

CNAME (alias) Node Symbolic link with the primary name of the represented node

PTR HostContains the canonical name of a host with its IP address (for reverse mapping)

HINFO Host Holds information on the host this node represents

TXT Any kind Contains any entity-specific information considered useful

Page 20: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

DNS Implementation (1)

• An excerpt from the DNS database for the zone cs.vu.nl.

Page 21: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

DNS Implementation (2)

• Part of the description for the vu.nl domain which contains the cs.vu.nl domain.

Name Record type Record value

cs.vu.nl NIS solo.cs.vu.nl

solo.cs.vu.nl A 130.37.21.1

Page 22: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

X.500• DNS is similar to a white page book.

• A different approach is directory service which resolves the problem using description of properties, instead of a full name: similar to yellow pages.

• An X.500 directory consists a number of records, as directory entries, similar to resource records. Each record as a collection of (attr, val).

• The collection of all entries is called a Dir. Info. Based (DIB). Each naming attribute is called a Relative Distinguished Name (RDN)

• Directory Information Tree (DIT) forms the naming graph

Page 23: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

The X.500 Name Space (1)

• A simple example of a X.500 directory entry using X.500 naming conventions.

Attribute Abbr. Value

Country C NL

Locality L Amsterdam

Organization L Vrije Universiteit

OrganizationalUnit OU Math. & Comp. Sc.

CommonName CN Main server

Mail_Servers -- 130.37.24.6, 192.31.231,192.31.231.66

FTP_Server -- 130.37.21.11

WWW_Server -- 130.37.21.11

Page 24: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

The X.500 Name Space (2)

• Part of the directory information tree.

Page 25: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

The X.500 Name Space (3)

• Two directory entries having Host_Name as RDN.

Attribute Value Attribute Value

Country NL Country NL

Locality Amsterdam Locality Amsterdam

Organization Vrije Universiteit Organization Vrije Universiteit

OrganizationalUnit Math. & Comp. Sc. OrganizationalUnitMath. & Comp. Sc.

CommonName Main server CommonName Main server

Host_Name Star Host_Name zephyr

Host_Address 192.31.231.42 Host_Address 192.31.231.66

Page 26: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Locating Mobile Entities

• Traditional naming systems are not so well suited for mobile entities.

• 3 types of names were discussed:– Human-friendly names

– Identifiers

– Addresses

• In all naming systems it is needed to have a mapping from names to addresses.

• 3 layers in DNS: Caching ad change in each layer.• It is better to restrict updates to a single name server.

Page 27: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Naming vs Locating (1)

• Assume ftp.cs.vu.nl is moved to ftp.cs.unisa.edu.au.• Two ways to cope with:

– -Record the address of the new machine for ftp.cs.vu.nl.

– Record the name of the new machine in DNS and create a symbolic link.

• However, if the machine moves frequently!• Each time an entity moves, a new operation is needed.• It is expected that our names are not changed.traditional naming services are not good for mobile

entities.

Page 28: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Naming versus Locating Entities

a) Direct, single level mapping between names and addresses.b) T-level mapping using identities.Identifiers never change, and never to refer to a different entity.

Page 29: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Forwarding Pointers (1)

• The principle of forwarding pointers using (proxy, skeleton) pairs.

Page 30: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Forwarding Pointers (2)

• Redirecting a forwarding pointer, by storing a shortcut in a proxy.

Page 31: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Home-based Approaches

• Bcasting and forwarding has the problem of scalability.

• An alternative approach is based on the comcept of home location.

• Home location is where an entity was created.

• It is used as a fall-back mechanism for location service based on forwarding pointer.

Page 32: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Home-Based Approaches• The principle of Mobile IP.

Page 33: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Home-based Approaches• It is assumed the home location is fixed.• However, when a mobile is moved forever!!• 0917 in moved for years to Tehran!• Two-tiered home-based approach can be extended into

multiple layers. Globe location services as a base for hierarchical

location services.• General mechanism: A network is partitioned into a

collection of domains (similar to the organization of DNS)

• The lowest level domain is called a leaf domain, corresponding to a LAN or a cell

Page 34: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Hierarchical Approaches (1)

• Hierarchical organization of a location service into domains, each having an associated directory node.

Page 35: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Hierarchical Approaches

• Location Record at different layers– At the leaf, the address only.– At the upper levels, each entity has a location record

pointing to the lower level node toward the entity.

• If an entity has multiple addresses, the smallest sub-domain containing both domains have multiple entries.

Page 36: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Hierarchical Approaches (2)

• An example of storing information of an entity having two addresses in different leaf domains.

Page 37: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Hierarchical Approaches (3)

• Looking up a location in a hierarchically organized location service.

Page 38: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Hierarchical Approaches (4)

a) An insert request is forwarded to the first node that knows about entity E.

b) A chain of forwarding pointers to the leaf node is created.

Page 39: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Pointer Caches (1)• Caching a reference to a directory node of the lowest-level

domain in which an entity will reside most of the time.

Page 40: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Pointer Caching

• Moving between two super domains like provinces! What is the best node for caching.

• Cache invalidation

Page 41: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Pointer Caches (2)• A cache entry that needs to be invalidated because it returns a

nonlocal address, while such an address is available.

Page 42: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Scalability Issues

• The root node should have a location record for all entities and process requests for each entity!!– Storage: 1,000,000,000 entries of 1k yields 1000GB.– Processing time and being bottleneck!

• A solution is to partition the root node and major nodes.– Where to put the subnodes (of the root).

• Close to each other (in a parallel computer)

• Spread the subnodes across the network.

Page 43: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Scalability Issues• The scalability issues related to uniformly placing subnodes of a partitioned

root node across the network covered by a location service.

Page 44: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Removing Unreferenced Entities

• Naming and location services provide a global referencing service for entities.

• As long as an entity is referred, it can be accessed and used.

• As soon as an entity can no longer be accessed, it should be removed.

• Alternatives– Manual. Impossible in large DSs. There is no info of

existence of a reference to an entity.

– Should take care, as in future the reference may be used!

– Distributed garbage collectors.

Page 45: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

The Problem of Unreferenced Objects• An example of a graph representing objects containing

references to each other.

Page 46: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Garbage Collection

• The model of referencing a remote object is through (proxy, skeleton)

• The process of garbage collection is transparent• An object itself may have references to remote objects.• An object for which no remote reference exists should

be removed.• Solutions: Reference counting

– Each time a reference is created, a reference counter is incremented. Removal of the reference decrementing the counter.

– Unreliable connection results in inconsistency!

Page 47: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Reference Counting (1)• The problem of maintaining a proper reference count in

the presence of unreliable communication.

Page 48: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Reference Counting (2)

a) Copying a reference to another process and incrementing the counter too late

b) A solution.

Page 49: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Reference counting

• Race condition in increment and decrement operations• A solution is to do just decrement.• When an object is created, the total weight is stored in

its associated skeleton.• When a new remote reference is created, half of the

partial weight is assigned to the new proxy.• Duplication of a remote reference (passing it from P1 to

P2), half of the weight is assigned to P2 proxy.• Destroy of a reference yields sending a decrement

message to the object.

Page 50: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Referencing Counting (1)

a) The initial assignment of weights in weighted reference countingb) Weight assignment when creating a new reference.

Page 51: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Referencing Counting (2)

c) Weight assignment when copying a reference.

Page 52: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Referencing Counting (3)• Creating an indirection when the partial weight

of a reference has reached 1.

Page 53: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Reference Counting• The problem is tracking the chains!• An Alternative approach is generation reference counting.• Assuming each remote ref. is constructed as (proxy, skeleton)

pair, and the only skeleton s is located in the same address as the object.

• Each proxy stores a counter of its being copied, plus a generation number.

• When a new ref (p, s) is created, the gen # of p is reset, its initial copy# is also set to 0.

• When a remote ref (p,s) to another process is done, the copy# is incremented, the gen# of the copy (p’) is also incremented.

• Another approach is reference listing in which the skeleton maintains the list of proxies have a ref to it.

Page 54: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Advanced Referencing Counting (4)

Creating and copying a remote reference in generation reference counting.

Page 55: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Identifying Unreachable Entities

• Mark and sweep collectors, achieve in two phases, mark and sweep, starting from some root entities.

• To cope with the scalability problem in tracing based GC, processes can be hierarchically organized into groups.

• GC is done locally into within groups through a combination of mark-and-sweep and reference counting.

• Groups are needed just for scalability.• The skeleton maintains the reference counter.

Page 56: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

In group Garbage Collection• 1- Initial marking• 2- Intra-process propagation of marks from skeleton to proxies• 3- Intra-process propagation of marks from proxies to skeletons• 4- Stabilization by repetition of the prev steps• 5- Garbage collection• A skeleton can be marked as soft or hard.• A proxy can be marked as none, soft, or hard.• Hard marked skeleton means reachability from a proxy outside

the group or from a root object inside the group.• Hard marked proxy means reachability from an object in the root

set. A soft proxy is reachable from a soft skeleton such proxies potentially lie in a non-reachable cycle.

• A proxy is marked none, if neither reachable from a skeleton, nor an object in the root set.

Page 57: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Tracing in Groups (1)

• Initial marking of skeletons.

Page 58: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Tracing in Groups (2)

• After local propagation in each process.

Page 59: Rasool Jalili, OS2, Sem1 82-83 Naming Chapter 4. Rasool Jalili, OS2, Sem1 82-83 Advertisment!! Please inform the students to subscribe to the mailing

Rasool Jalili, OS2, Sem1 82-83

Tracing in Groups (3)

• Final marking.