Unified-OS
  • #️Unified OS
  • 🚀Getting Started
    • Installation
    • Booting
  • Architecture
    • Overview
    • ACPI
    • APIC
    • Constructors
    • ELF - Executables
    • Higher Kernel
    • IDT (Interrupts)
    • IPC
    • Kernel Objects and Watchers
    • Memory Management
    • PCI
    • PIT
    • Scheduling
    • Serial
    • Signals
    • SMP
    • Spinlocks
    • Syscalls
    • UFEI Bootloader and Setup
  • Drivers
    • SATA
    • Video
  • Other
    • FAT-32
    • Filesystem
    • Heap
    • Page
  • Processes
    • Libraries
      • MLibc
      • Libunified
    • OS-Based Processes
      • Daemon
      • Window Manager
  • Contributing
    • Contributing
Powered by GitBook
On this page
  1. Architecture

Spinlocks

Spinlocks are a way of blocking code from being run multiple times at once. This is mainly important when writing to disks and allocating memory as we don't want to access the same position at once.

They make use of the compilers atomic features.

acquireLock(lock){
	while (__atomic_exchange_n(lock, 1, __ATOMIC_ACQUIRE)){
		asm("pause");
	}
}
PreviousSMPNextSyscalls

Last updated 1 year ago