Author: Gerd Isenberg
Date: 23:43:38 11/04/02
Go up one level in this thread
On November 05, 2002 at 02:01:51, Gian-Carlo Pascutto wrote: >On November 04, 2002 at 16:35:29, Gerd Isenberg wrote: > >><snip> >> >>Gian-Carlo, >> >>Isn't it necessary to use the lock prefix before xchg? > >I don't know Gerd. I based this snipped on the locking code >in Crafty, and it appears to work fine. > >-- >GCP Aha, then Bob Hyatt may answer this question. The lock prefix makes the "xchg"-instruction (read- and write cycle) atomic. So there may be rare cases, where two or more processers do the instruction at the same time, both reading the semaphore just before the write cycle occurs - and both get zero.... I thought the lock prefix is exactly for that purpose. Gerd
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.