Safe Semantics
   HOME

TheInfoList



OR:

Safe semantics is a
computer hardware Computer hardware includes the physical parts of a computer, such as the computer case, case, central processing unit (CPU), Random-access memory, random access memory (RAM), Computer monitor, monitor, Computer mouse, mouse, Computer keyboard, ...
consistency model In computer science, a consistency model specifies a contract between the programmer and a system, wherein the system guarantees that if the programmer follows the rules for operations on memory, memory will be consistent and the results of readi ...
. It describes one type of guarantee that a data register provides when it is shared by several
processors A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
in a
parallel computer Parallel computing is a type of computation in which many calculations or processes are carried out simultaneously. Large problems can often be divided into smaller ones, which can then be solved at the same time. There are several different for ...
or in a network of computers working together.


History

Safe semantics was first defined by
Leslie Lamport Leslie B. Lamport (born February 7, 1941 in Brooklyn) is an American computer scientist and mathematician. Lamport is best known for his seminal work in distributed systems, and as the initial developer of the document preparation system LaTeX and ...
in 1985. It was formally defined in Lamport's "On Interprocess Communication" in 1986. Safe register has been implemented in many distributed systems.


Description

Safe semantics are defined for a variable with a single writer but multiple readers (SWMR). A SWMR register is safe if each read operation satisfies these properties: # A read operation not concurrent with any write operation returns the value written by the latest write operation. # A read operation that is concurrent with a write operation may return any value within the register's allowed range of values (for example, 0,1,2,...). In particular, given concurrency of a read and a write operation, the read can return a value that has not been written by a write. The return value need only belong to the register domain. A binary safe register can be seen as modeling a bit flickering. Whatever the previous value of the register is, its value could flicker until the write finishes. Therefore, the read that overlaps with a write could return 0 or 1. ''Churn'' refers to the entry and exit of servers to/from a distributed system. Baldoni et al. show that no register can have the stronger property of
regular semantics Regular semantics is a computing term which describes one type of guarantee provided by a data register shared by several processors in a parallel machine or in a network of computers working together. Regular semantics are defined for a variabl ...
in a
synchronous system In digital electronics, a synchronous circuit is a digital circuit in which the changes in the state of memory elements are synchronized by a clock signal. In a sequential digital logic circuit, data are stored in memory devices called flip-fl ...
under continuous churn. However, a safe register can be implemented under continuous churn in a non-synchronous system. Modeling and implementing a type of storage memory (Safe Register) under non-quiescent churn requires some system models such as client and server systems. Client systems contains a finite, arbitrary number of processes that are responsible for reading and writing the server system. However, the server system must ensure that read and write operations happen properly.


Implementation

Safe register implementation involves: Safe register is maintained by the set of active servers. Clients maintain no register information. Eventually synchronous system Quora (set of server or client systems) Size of the Read and Write operation executed on quora = n – f – J (n is the number of servers, J is the number of servers that enter and exit, and f is the number of Byzantine failures. Algorithms such as join, read, and write.


Join

A server (''si'') that wants to enter a server system broadcasts an inquiry message to other servers to inform them of its entry, si requests a current value of the register. Once other server receive this inquiry they send reply messages to si. After si receives enough replies from other servers, it collects the replies and saves them into a reply set. Si waits until it gets enough replies (n-f-j) from other servers then it picks the most frequently received value. Si also: * Updates its local copy of the register * Becomes active * Replies to the processes in the reply set * If it becomes active it sends reply messages to the other servers. Otherwise, it stores the inquiries, replying when it becomes active. * When it gets replies from other servers it adds the new reply to the reply set and discards the old value. * If the value of the responding server is bigger than si's value, si retains the new value.


Read

The read algorithm is a basic version of join. The difference is the broadcast mechanism used by the read operation. A client (''cw'') broadcasts a message to the system and once a server receives the inquiry, it sends a reply message to the client. Once the client receives enough replies (n-f-j) it stops sending an inquiry.


Write

Client (''cw'') sends an inquiry into the system in different rounds and waits until it receives two acknowledgment. (''sn'' =sequence number) The reason for receiving two acknowledgments is to avoid danger in a system. When a process sends an acknowledgement (''ack''), it may die after one millisecond. Therefore, no confirmation is received by the client. The validity of the safe register (If a read is not concurrent with any write, return the last value written) was proved based on the quorum system. Given two quorum systems (Qw, Qr) Qw indicates the servers that know about the latest value, and Qr indicates values of read responses. The size of each quorum is equal to n-f-j. Proving the safe register's validity requires proving (Qw \cup Qr)\backslash B >(Qr \cup B) were ''B'' is the number of Byzantine failures. Proof : Red region indicates (Qw∩Qr)\B and the blue region indicates Qr∩B. From the assumption, the size of each quorum is n-f-j, so the red region has n-3f-2j active servers. Therefore, n-3f-2J > f --> n > 4f+2J --> n is strictly greater than f.


Notes


See also

*
Regular semantics Regular semantics is a computing term which describes one type of guarantee provided by a data register shared by several processors in a parallel machine or in a network of computers working together. Regular semantics are defined for a variabl ...
* Atomic semantics {{DEFAULTSORT:Safe Semantics Concurrency control