Spin lock

From DALL-E with some prompting
The image illustrates a comparison between the costs associated with spinlocks and context switching. It contrasts the ‘waiting cost’ incurred when a process is on hold while another process monopolizes a CPU core, with the ‘switching cost’ that arises from transitioning between processes. Spinlocks represent the waiting cost as a process continually attempts to access the CPU, thereby avoiding unnecessary context switches and increasing efficiency. Particularly in multi-CPU environments, the system underscores the ability to handle multiple processes efficiently without the need for operating system-induced switching.