From mboxrd@z Thu Jan 1 00:00:00 1970 From: jmk@plan9.bell-labs.com Message-Id: <200007200203.WAA24856@cse.psu.edu> Subject: Re: [9fans] Kernel question: i386 test-and-set problem Date: Wed, 19 Jul 2000 22:03:27 -0400 To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: e69f308c-eac8-11e9-9e20-41e7f4b1d025 >Richard Miller writes: > >Russ Cox 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 I think that's a misrepresentation. The sleep/wakeup/postnote Rendez structure still has a lock which protects it, it just moved somewhere else. The 2nd Edition code would have needed coherence() calls too, but in different places, had it not been rewritten before we tried running on a multiprocessor Pentium Pro. Sleep/wakeup/postnote in the 2nd Edition was hopelessy broken in many other ways. --jim