What happens if two process in different processors try to acquire the lock at EXACTLY same time

前端 未结 5 1242
忘掉有多难
忘掉有多难 2020-12-13 02:48

Ok, so I am reading about synchronization, and I read through various algorithms such as spinlocks, semaphores, and mutex to avoid race condition.

However, these alg

5条回答
  •  悲哀的现实
    2020-12-13 03:31

    I strongly recommend Curt Schimmel's UNIX® Systems for Modern Architectures: Symmetric Multiprocessing and Caching for Kernel Programmers. Different hardware architectures provide different low-level tools for synchronizing access to data, including some architectures with very nearly no help. Schimmel's book provides algorithms that can work even on those architectures.

    I wish I could easily locate my copy to summarize the contents.

提交回复
热议问题