Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Composition in computer science is the ability to assemble complex behaviour by aggregating simpler behaviour. Functional decomposition is an example of this, whereby a complex function is broken up into smaller easy-to-grasp functions and assembled into the final system by a top-level function. The top-level function can be said to have "composed" the pieces into the whole.</p> <p>Certain concepts don't easily compose. For instance, a thread-safe data structure may allow safe insertion and removal of elements, and it does this by locking the data structure or some subset of it so that one thread can perform the necessary manipulations without having its changes intruded upon &mdash; and the data structure corrupted &mdash; while it works. However, a business function might require the removal of an element from one collection, followed by its insertion into another, and for the entire operation to be performed atomically. The problem is that locking only occurs per data structure. You can safely remove an element from one, but then you might find that can't insert it into the other because of some key violation. Or you might try inserting it into the one second and then removing it from the first, only to find that another thread has stolen it from under your nose. On realising that you can't complete the operation, you could try to put things back the way they were, only to find that the reversal fails for similar reasons, and you are now in limbo! You could, of course, implement a richer locking scheme that covers multiple data structures, but that only works if everyone agrees to the new locking scheme, and wears the burden of using it all the time, even when all their operations are on a single data structure.</p> <p>Mutex-style locking is thus a concept that doesn't compose. You can't implement higher-level thread-safe behaviour simply by aggregating lower-level thread-safe operations. The solution in this case is to use a concept that does compose, such as <a href="http://en.wikipedia.org/wiki/Software_transactional_memory" rel="noreferrer">STM</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload