Quant Interview Practice Questions
题目详情
You are designing a low-latency trading system. You need to choose between a spin lock and a mutex for protecting a critical section of code that updates shared market data. Context switch time on your system is approximately 500 nanoseconds. You estimate that the average time a thread needs to hold the lock is either 100 nanoseconds with a probability of 0.9, or 1 microsecond with a probability of 0.1. Under what circumstances would a spin lock be preferred over a mutex, assuming minimizing lat