Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Safe semantics
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{confusing|date=January 2015}}<!-- found by [[Wikipedia:Typo Team/moss]] --> '''Safe semantics''' is a [[computer hardware]] [[consistency model]]. It describes one type of guarantee that a [[Processor register|data register]] provides when it is shared by several [[Central processing unit|processors]] in a [[Parallel computing|parallel computer]] or in a network of computers working together. == History == Safe semantics was first defined by [[Leslie Lamport]] in 1985.<ref>{{Cite journal|last=Lamport|first=Leslie|date=June 1986|title=On interprocess communication: Part I: Basic formalism|url=https://lamport.azurewebsites.net/pubs/interprocess.pdf|journal=Distributed Computing|volume=1|issue=2|pages=77β85|doi=10.1007/BF01786227|s2cid=22834932 |issn=0178-2770}}</ref> It was formally defined in Lamport's "On Interprocess Communication" in 1986.<ref>{{Cite journal|last=Lamport|first=Leslie|date=June 1986|title=On interprocess communication: Part I: Basic formalism|journal=Distributed Computing|volume=1|issue=2|pages=77β85|doi=10.1007/BF01786227|s2cid=22834932 |issn=0178-2770}}</ref> 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:[[File:Safe register-no overalapping.jpg|thumb|Safe register-no overlapping]] # 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,...). [[File:Safe register-overallping.jpg|thumb|safe register-overlapping]] 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]] in a [[Synchronous circuit|synchronous system]] under continuous churn.<ref>{{Cite journal|last1=Baldoni|first1=Roberto|last2=Bonomi|first2=Silvia|last3=Raynal|first3=Michel|date=January 2012|title=Implementing a Regular Register in an Eventually Synchronous Distributed System Prone to Continuous Churn|journal=IEEE Transactions on Parallel and Distributed Systems|volume=23|issue=1|pages=102β109|doi=10.1109/TPDS.2011.97|s2cid=12717004 |issn=1045-9219}}</ref> However, a safe register can be implemented under continuous churn in a non-synchronous system.<ref name="BBN" /> Modeling and implementing a type of storage memory (Safe Register) under non-quiescent churn requires some system models such as client and server systems.<ref name="BBN">{{Cite journal|last1=Baldoni|first1=Roberto|last2=Bonomi|first2=Silvia|last3=Nezhad|first3=Amir Soltani|date=November 2013|title=A protocol for implementing byzantine storage in churn-prone distributed systems|journal=Theoretical Computer Science|volume=512|pages=28β40|doi=10.1016/j.tcs.2013.04.005|doi-access=free}}</ref> 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 fault|Byzantine failures]]. Algorithms such as join, read, and write.<ref name="BBN" /> === 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.<ref name=BBN/> 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.<ref name=BBN/> Proving the safe register's validity requires proving <math>(Qw \cup Qr)\backslash B >(Qr \cup B)</math> 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, <math>n-3f-2J > f \implies n > 4f+2J \implies n </math> is strictly greater than f. [[File:Validity.jpg|center|validity]] ==Notes== {{reflist}} ==See also== * [[Regular semantics]] * [[Atomic semantics]] {{DEFAULTSORT:Safe Semantics}} [[Category:Concurrency control]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Ambox
(
edit
)
Template:Cite journal
(
edit
)
Template:Confusing
(
edit
)
Template:Reflist
(
edit
)