A linux kernel develepor decides to simplify the seqlock and replaces the counter with a boolean variable, set to true (1) when a writer enters its critical section and reset to false (0) when the writer leaves its critical section. To the developer’s surprise, the kernel began to occasionally malfunction, causing the system to crash.
• What do you think the problem is in the simplification that might cause the kernel to malfunction? • How does the use of a counter fix it and is there any scenario under which even the counter might fail to properly synchronize the readers and writers (i.e., what are the assumptions under which the counter-based implementation works)?
Comments
Leave a comment