From owner-freebsd-hackers Thu Dec 12 18:44:48 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id SAA05373 for hackers-outgoing; Thu, 12 Dec 1996 18:44:48 -0800 (PST) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id SAA05365 for ; Thu, 12 Dec 1996 18:44:38 -0800 (PST) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.3/CET-v2.1) with SMTP id CAA12318 for ; Fri, 13 Dec 1996 02:44:25 GMT Date: Fri, 13 Dec 1996 11:44:25 +0900 (JST) From: Michael Hancock To: FreeBSD Hackers Subject: Implementing atomic DCAS on Intel for NBS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk It doesn't look like the P5 has DCAS which is important for NBS because it wants to atomically manipulate a structure and update it's version number. Here's some pseudo code: int DCAS( int *p1, int *p2, int old1, int old2 int new1, int new2) { if ((*p1 == old1) && (*p2 == old2)) { *p1 = new1; *p2 = new2; return TRUE; } else { return FALSE; } } Is there an an assembler guru out there who can tell us how many instructions would be necessary to implement this for a P5? Here's a link for an R4000 version: http://www-dsg.stanford.edu/papers/non-blocking-osdi/node11.html Regards, Mike Hancock