Spin-Lock

Spin-Lock

Ein Spinlock (Spin-Lock) ist ein Mechanismus der Prozesssynchronisation. Es ist eine Sperre (Lock) in Form einer Variablen zum Schutz von gemeinsam genutzten Ressourcen (Datenstrukturen) vor modifizierendem Zugriff durch konkurrierende Prozesse bzw. Threads (s. Kritischer Abschnitt). Die Sperre wird durch aktives Warten überwunden:

solange (Sperrvariable besitzt Wert 'gesperrt') {
   tue nichts;
}
setze Sperrvariable auf 'gesperrt'
modifiziere Ressource
setze Sperrvariable auf 'offen'

Der Prozess/Thread, der die Sperrvariable auf 'gesperrt' setzt, wird als Besitzer der Sperrvariable bezeichnet. Versucht ein Prozess/Thread in den Besitz der Sperrvariable zu gelangen, wenn diese im Besitz eines anderen Prozesses/Threads ist, so wartet er auf die Freigabe aktiv. Dieses aktive und Prozessorkapazität verschwendende Warten ist ein wesentliches Merkmal der als Spinlock eingesetzten Sperrvariable. Die Sperrvariable soll jeweils nur für kurze Zeit im Besitz eines Prozesses/Threads sein. Prozess-/Threadwechsel, die einen Verwaltungsaufwand erfordern und die erforderlich wären, wenn die Sperrvariable nicht aktiv abgefragt würde, sollen vermieden werden, wenn der Aufwand für die Veränderung der Ressource gering ist.

Da die Veränderung der Sperrvariablen ihrerseits geschützt werden muss, werden sie abhängig von der Prozessorarchitektur implementiert.


Wikimedia Foundation.

Игры ⚽ Поможем написать реферат

Schlagen Sie auch in anderen Wörterbüchern nach:

  • Lock, Shock, and Barrel — are fictional characters in the animated movie The Nightmare Before Christmas . Introduced as Oogie Boogie s not so loyal little henchmen (possibly against their will), all three are trick or treaters, with faces similar to their masks (e.g.… …   Wikipedia

  • spin|dle — «SPIHN duhl», noun, adjective, verb, dled, dling. –n. 1. a rod or pin used in spinning to twist, wind, and hold thread. In hand spinning, the spindle is a round, usually wooden rod, tapering toward each end, that revolves and twists into thread… …   Useful english dictionary

  • Line lock — A line lock is a device that allows you to lock the front brakes independently of the rear brakes via a switch. [http://www.hotrod.com/howto/49619 brake line lock install/index.html] , Installing a Brake Line Lock.]… …   Wikipedia

  • Anti-lock braking system — An anti lock braking system (ABS, from German: Antiblockiersystem) is a safety system that allows the wheels on a motor vehicle to continue interacting tractively with the road surface as directed by driver steering inputs while braking,… …   Wikipedia

  • Option Lock — Doctor Who book Option Lock Series Eighth Doctor Adventures …   Wikipedia

  • RP 21 Sapfir Spin Scan-A — The RP 21 Sapfir was a radar system, developed by the Soviet Union for use in the updated MiG 21PF fighter, and later versions of the MiG 21.The early MiG 21 fighter variants, MiG 21 F and MiG 21F 13, were clear weather daylight only fighters.… …   Wikipedia

  • anti-spin regulation — (ASR) The control or prevention of wheelspin under power, normally by means of electronic sensing and in conjunction with anti lock brakes …   Dictionary of automotive terms

  • wheel spin sensors — Sensors used in the anti lock brake systems to determine the rate of wheel rotation …   Dictionary of automotive terms

  • Spinlock — In software engineering, a spinlock is a lock where the thread simply waits in a loop ( spins ) repeatedly checking until the lock becomes available. As the thread remains active but isn t performing a useful task, the use of such a lock is a… …   Wikipedia

  • Test-and-set — In computer science, the test and set instruction is an instruction used to both test and (conditionally) write to a memory location as part of a single atomic (i.e. non interruptible) operation. This means setting a value, but first performing… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”