Friedrich-Alexander-Universität UnivisSuche FAU-Logo
Techn. Fakultät Willkommen am Department Informatik FAU-Logo
Logo I4
Lehrstuhl für Informatik 4
SP
 
  Vorlesung
  Folien
  Übungen
  Evaluation
  Prüfungsinformationen
  Forum
  protected area Intern
Übungen
  Folien
  Aufgaben
Department Informatik  >  Informatik 4  >  Lehre  >  WS 2010/11  >  SP  >  Übung  >  Doku  >  multithreaded webserver: cas.h File Reference

process list

cas.h File Reference

CAS implementation using the cmpxchg x86 instruction. More...

Go to the source code of this file.

Typedefs

typedef unsigned long word_t

Functions

__inline__ int cas (word_t *ref, word_t exp, word_t val)
 Compare and swap emulated using CMPXCHG.


Detailed Description

CAS implementation using the cmpxchg x86 instruction.


Typedef Documentation

typedef unsigned long word_t

Type for a machine word.


Function Documentation

__inline__ int cas ( word_t ref,
word_t  exp,
word_t  val 
)

Compare and swap emulated using CMPXCHG.

Register EAX (exp) holds the value expected to be stored at the specified memory location (*ref). If this value is still stored there, the memory location gets overwritten by the new value (val). The function returns nonzero (true) if the new value was stored, zero (false) otherwise.

Note: extern inline forces GCC to always inline this function an to not generate a standalone version of the function.

  Impressum   Datenschutz Stand: 2011-01-24 10:23   MS