Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!ogccse!husc6!m2c!umvlsi!dime!yodaiken From: yodaiken@freal.cs.umass.edu (victor yodaiken) Newsgroups: comp.arch Subject: self-modifying code Message-ID: <5546@dime.cs.umass.edu> Date: 12 Oct 89 14:50:34 GMT Sender: news@dime.cs.umass.edu Reply-To: yodaiken@freal.cs.umass.edu (victor yodaiken) Organization: University of Massachusetts, Amherst Lines: 17 Forget where I saw this nice example of self-modifying code. It was billed as one ofthe earliest mutual exclusion programs. L: move opcode["branch to L"] to L critical region ... move opcode[" move opcode["branch to L"]] to L The first programto execute the instruction at L changes the instruction so that all others will just busy loop, and then changes it back when it leaves the critical region Of course it only works for uni-processors. victor