• Navigation überspringen
  • Zur Navigation
  • Zum Seitenende
Organisationsmenü öffnen Organisationsmenü schließen
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
  • FAUZur zentralen FAU Website
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Suche öffnen
  • English
  • Campo
  • StudOn
  • FAUdir
  • Stellenangebote
  • Lageplan
  • Hilfe im Notfall
  1. Friedrich-Alexander-Universität
  2. Technische Fakultät
  3. Department Informatik
Friedrich-Alexander-Universität Lehrstuhl für Informatik 4 (Systemsoftware)
Menu Menu schließen
  • Lehrstuhl
    • Team
    • Aktuelles
    • Kontakt und Anfahrt
    • Leitbild
    • 50-jähriges Jubiläum
    Portal Lehrstuhl
  • Forschung
    • Forschungsbereiche
      • Betriebssysteme
      • Confidential Computing
      • Embedded Systems Software
      • Verteilte Systeme
    • Projekte
      • AIMBOS
      • BALu
      • BFT2Chain
      • DOSS
      • Mirador
      • NEON
      • PAVE
      • ResPECT
      • Watwa
    • Projektkampagnen
      • maRE
    • Seminar
      • Systemsoftware
    Portal Forschung
  • Publikationen
  • Lehre
    • Sommersemester 2025
      • Applied Software Architecture
      • Ausgewählte Kapitel der Systemsoftware
      • Betriebssystemtechnik
      • Projekt angewandte Systemsoftwaretechnik
      • System-Level Programming
      • Systemnahe Programmierung in C
      • Systemprogrammierung 1
      • Verteilte Systeme
    • Wintersemester 2025/26
      • Systemprogrammierung 2
      • Betriebssysteme
      • Middleware – Cloud Computing
      • Echtzeitsysteme
      • Virtuelle Maschinen
      • Web-basierte Systeme
      • Projekt angewandte Systemsoftwaretechnik
      • Aktuelle Entwicklung in Verteilten und Objektorientierten Betriebssystemen (für Bachelor-/Masterarbeit)
    Portal Lehre
  • Examensarbeiten
  1. Startseite
  2. Extern

Extern

Bereichsnavigation: Lehre
  • Betriebssysteme
    • Vorlesung
      • Folien
    • Übung
      • Seminar
      • Aufgaben
      • Aufgabe 0: C++ Streams
        • Aufgabe 1: Ein-/Ausgabe
          • Aufgabe 2: Unterbrechungen
            • Aufgabe 3: Pro-/Epilog
              • Aufgabe 4: Kontextwechsel
                • Assembler Crashkurs
                  • C++ Crashkurs
                    • Entwicklungsumgebung
                      • FAQ
                        • Ruhmeshalle

                      Aufgabe 2: Unterbrechungen

                      Public Member Functions | List of all members
                      Ticketlock Class Reference
                      CPU Synchronization

                      By the use of Ticketlocks, it is possible to serialize blocks of code that might run parallel on multiple CPU cores. More...

                      #include <sync/ticketlock.h>

                      Public Member Functions

                       Ticketlock ()
                       Constructor. More...
                       
                      void lock ()
                       Enters the critical area. In case the area is already locked, lock() will actively wait for the area can be entered. More...
                       
                      void unlock ()
                       Unblocks the critical area. More...
                       

                      Detailed Description

                      By the use of Ticketlocks, it is possible to serialize blocks of code that might run parallel on multiple CPU cores.

                      Synchronization is implemented using a lock and a ticket variable. Once a thread tries to enter the critical area, it obtains a ticket by atomic increment of the ticket variable and waits until the lock variable is equal to its ticket. When a thread leaves the critical area, it increments the lock variable by one and thereby allows the next thread to enter the critical area.

                      Note
                      If you want that things just work, choose __ATOMIC_SEQ_CST as memorder. This is not the most efficient memory order but works reasonably well.

                      Atomic Builtins in GCC manual

                      Constructor & Destructor Documentation

                      Ticketlock::Ticketlock ( )
                      inline

                      Constructor.

                      Todo:
                      Complete Constructor (for MPStuBS)

                      Member Function Documentation

                      void Ticketlock::lock ( )
                      inline

                      Enters the critical area. In case the area is already locked, lock() will actively wait for the area can be entered.

                      See also
                      Core::pause()
                      Todo:
                      Implement Method (for MPStuBS)
                      void Ticketlock::unlock ( )
                      inline

                      Unblocks the critical area.

                      Todo:
                      Implement Method (for MPStuBS)

                      The documentation for this class was generated from the following file:
                      • sync/ticketlock.h
                      Friedrich-Alexander-Universität
                      Erlangen-Nürnberg

                      Schlossplatz 4
                      91054 Erlangen
                      • Impressum
                      • Datenschutz
                      • Barrierefreiheit
                      • Facebook
                      • RSS Feed
                      • Xing
                      Nach oben