From owner-freebsd-hackers Tue Oct 3 1: 3:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from penfold.transactionsite.com (penfold.transactionsite.com [203.14.245.1]) by hub.freebsd.org (Postfix) with SMTP id 1321237B502 for ; Tue, 3 Oct 2000 01:03:03 -0700 (PDT) Received: (qmail 22679 invoked from network); 3 Oct 2000 08:02:51 -0000 Received: from haym.transactionsite.com (HELO haym) (192.168.1.9) by penfold.transactionsite.com with SMTP; 3 Oct 2000 08:02:51 -0000 Message-ID: <001201c02d0f$790c9140$0901a8c0@haym.transactionsite.com> From: "Jan Mikkelsen" To: "John Baldwin" Cc: "FreeBSD Hackers" , "Kevin Mills" Subject: Re: atomic operations Date: Tue, 3 Oct 2000 18:56:43 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG John Baldwin wrote: >Uh, there is no xaddl instruction in the x86 instruction set. It was introduced in the '486. I've been using it for some years now, so I am confident of its existence. A quick test using my example: $ objdump -d jan.o jan.o: file format elf32-i386 Disassembly of section .text: 00000000 : 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 8b 4d 08 mov 0x8(%ebp),%ecx 6: b8 ff ff ff ff mov $0xffffffff,%eax b: f0 0f c1 01 lock xadd %eax,(%ecx) f: 48 dec %eax 10: c9 leave 11: c3 ret There shouldn't be a need for a loop like the one you describe for a simple atomic increment. I'm pretty new to FreeBSD: what is changing in -current which alters the behaviour of your code? Jan Mikkelsen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message