Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
13 user(s) are online (11 user(s) are browsing encyclopedia)

Members: 0
Guests: 13

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

Atomicity

In computer science, an atomic operation is one that appears to happen instantaneously. Atomicity implies indivisibility and irreducibility, so an atomic operation must appear to be performed entirely or not at all. Note that this is not actually the case; even a simple add operation in code requires perhaps three to five register operations. The operating system and computer architecture, however, can ensure that nothing interrupts that sequence of register operations, resulting in the appearance of atomicity.

Atomicity can prevent read-write and write-write conflicts. Suppose one Thread_(computer_science) of a program attempts to write the value updated to a memory location with the string initial , while another thread simultaneously attempts to read it. If the string read and write operations are not both atomic, the second thread may read the value updaial when it should read either initial or updated . Similarly, suppose two threads simultaneously attempt to write to the same memory space containing an integer value. If the integer write operation is non-atomic and the threads attempt to write 7 and 0, the bits may be mangled and a 5 may be written instead.

Many processor, especially 32-bit ones with 64-bit Floating point support, provide some read and write operations that are not atomic. Most processors provide an operation that can simultaneously read a location and update it in the same bus operation. This prevents any other processor or input-output device from writing or reading memory until the operation is complete.

==Examples of atomic operations==

  • In database systems, atomicity is one of the ACID properties for transactions. Either all steps in a transaction succeed, or the entire transaction is rolled back; partial completion should never be observed.
  • In concurrent programming, an atomic operation has the additional property that none of its effects are visible until after it completes. That is, that there are no intermediate states visible to other Thread (computer programming). In database systems, this property is classified separately as Isolation (computer science) . This definition of atomic is equivalent to linearizability.
  • In operating systems, an atomic operation is an operation that is not (or cannot be) interrupted once it has begun. For example, basic machine instructions like add or store are usually guaranteed by the hardware to be atomic, and some platforms provide a pair of operations (Load-Link/Store-Conditional) that only have an effect if they occur atomically. This property can be used to implement Lock (software engineering), a vital mechanism for multithreading programming.
  • ==Other meanings==

    There are several other unrelated meanings of the word atomic in computing:

  • In symbolic languages, like Lisp programming language, S-expressions are made of atoms and lists of S-expressions. S-expressions are then atomic if they are atoms, for example, numerics or symbols.
  • *In the context of component-based paradigms, atomicity is an element of orthogonality. Possibly guaranteeing hermetic interfaces among components of a component-based system. Malfunctions in one component would result in side-effects in another component . In addition atomicity guarantees that services provided by a component are either offered as a whole, or not at all. Systems built according to this design principle localise the side-effects of changes within the package.

  • In other areas of computer science, atomic can mean the smallest addressable unit of memory. The byte is typically atomic in this sense.
  • = See also =

  • Compare-and-swap
  • Test-and-set