Ping-pong Scheme
   HOME

TheInfoList



OR:

Algorithms said to employ a Ping-Pong scheme exist in different fields of
software engineering Software engineering is a systematic engineering approach to software development. A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term '' ...
. They are characterized by an alternation between two entities. In the examples described below, these entities are communication partners, network paths or file blocks.


Databases

In most
database management systems In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
durable Durability is the ability of a physical product to remain functional, without requiring excessive maintenance or repair, when faced with the challenges of normal operation over its design lifetime. There are several measures of durability in use, ...
database transaction A database transaction symbolizes a unit of work, performed within a database management system (or similar system) against a database, that is treated in a coherent and reliable way independent of other transactions. A transaction generally repr ...
s are supported through a log file. However, multiple writes to the same page of that file can produce a slim chance of data loss. Assuming for simplicity that the log file is organized in pages whose size matches the
block Block or blocked may refer to: Arts, entertainment and media Broadcasting * Block programming, the result of a programming strategy in broadcasting * W242BX, a radio station licensed to Greenville, South Carolina, United States known as ''96.3 ...
size of its underlying medium, the following problem can occur: If the very last page of the log file is only partially filled with data and has to be written to permanent storage in this state, the very same page will have to be overwritten during the next write operation. If a
crash Crash or CRASH may refer to: Common meanings * Collision, an impact between two or more objects * Crash (computing), a condition where a program ceases to respond * Cardiac arrest, a medical condition in which the heart stops beating * Couch su ...
happens during that later write operation, previously stored log data may be lost. The Ping-Pong scheme described in ''Transaction Processing'' eliminates this problem by alternately writing the contents of said (logical) last page to two different physical pages inside the log file (the actual last page ''i'' and its empty successor ''i+1''). Once said logical log page is no longer the last page (i.e. it is completely filled with log data), it is written one last time to the regular physical position (''i'') inside the log file. This scheme requires the usage of time stamps for each page in order to distinguish the most recent version of the logical last page one from its predecessor.


Networking


Internet

A functionality which lets a computer A find out whether a computer B is reachable and responding is built into the Internet Control Message Protocol (ICMP). Through an "Echo Request" Computer A asks B to send back an "Echo Reply". These two messages are also sometimes erroneously called "
ping Ping may refer to: Arts and entertainment Fictional characters * Ping, a domesticated Chinese duck in the illustrated book '' The Story about Ping'', first published in 1933 * Ping, a minor character in ''Seinfeld'', an NBC sitcom * Ping, a c ...
" and "pong".


Routing

In Routing, a Ping-Pong scheme is a simple algorithm for distributing data packets across two paths. If you had two paths A and B, then the algorithm would randomly start with one of the paths and then switch back and forth between the two.{{Cite book , last1=Swaminathan , first1=K. , last2=Lakshminarayanan , first2=G. , last3=Ko , first3=Seok-Bum , title=2012 International Symposium on Electronic System Design (ISED) , chapter=High Speed Generic Network Interface for Network on Chip Using Ping Pong Buffers , date=December 2012 , chapter-url=https://ieeexplore.ieee.org/document/6526556 , pages=72–76 , doi=10.1109/ISED.2012.11, isbn=978-1-4673-4704-4 , s2cid=23635498 If you were to get the next path from a function call, it would look like this in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
: def get_next_path(): while True: yield 'A' yield 'B'


References

Algorithms