|
|
Log in / Subscribe / Register

Problem with ex 2 ?

Problem with ex 2 ?

Posted Dec 27, 2007 18:57 UTC (Thu) by PaulMcKenney (✭ supporter ✭, #9624)
In reply to: Problem with ex 2 ? by xav
Parent article: What is RCU, Fundamentally?

Indeed!  As with the preceding example, there must be some sort of mutual exclusion in play,
and as in the preceding example, this mutual exclusion is not shown explicitly.

One approach, as you say, would be to add locking, perhaps similar to that described in the
answer to Quick Quiz 4 (but for the deletion example).  Another approach would be to hold a
mutex (in the old style, "semaphore") across the entire code segment.  Yet a third approach
would be to permit only a single designated task to do updates (in which case the code would
remain as is).  There are other approaches as well.

In any case, I am glad to see that people are sensitized to the need for mutual exclusion in
parallel code!


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds