Concurrency And Synchronization in Linux
Let us take a quick look at a fragment of hypothetical device memory management code. Device is checking whether the memory it requires has been allocated yet or not. if (!dptr->data[s_pos]) { dptr->data[s_pos] = kmalloc(quantum, GFP_KERNEL); if (!dptr->data[s_pos]) goto out; } Suppose for a moment that two processes (we’ll call [...]