9fans archive / 2000 / 07 / 151 prev next
From: miller@ham...
Subject: Kernel question: i386 test-and-set problem
Date: Mon, 10 Jul 2000 17:21:41 BST
Russ Cox <rsc@pla...> writes:
> ... Since we don't
> play funny games with lock-free data structures, ...
A notable exception is the funny game which sleep() and wakeup()
play with the Rendez structure, which no longer has the lock
which protected it in the original 2nd edition kernel. This game
is not just funny but dangerous, as evidenced by the new coherence()
calls introduced to counteract the resulting vulnerability to weakly
coherent memory on some multiprocessors, and the long explanatory
comment.
Kids, don't try this at home ... practise the discipline of Safe
Sharing (always use a lock) and you won't need to worry about
memory coherence.
-- Richard Miller