From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 3 14:59:49 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56A9106566B; Mon, 3 Oct 2011 14:59:49 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 3AA4A8FC14; Mon, 3 Oct 2011 14:59:48 +0000 (UTC) Received: by wwe3 with SMTP id 3so5531237wwe.31 for ; Mon, 03 Oct 2011 07:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=zYgCbi5Bc0IFcYvS0BCbg2IAcVjUru/ebTJuhA5IYq8=; b=JkCefo/HIE8SF/Q8dZiUD1bD2angv/wKqYQ0F3vYbhx4AfbocrJTQOOQ4dtZHoZdXF LNYv08n2dVOIjBF8TSWkd0U6vUArOBVYq2zFucC/miX2XiDMJRbTMcrvPhzuuyXXjTOa DtjL7nMKjWW9Jwmb3ZE69xWUibkdL7UwOqh4g= MIME-Version: 1.0 Received: by 10.227.179.14 with SMTP id bo14mr3114152wbb.90.1317652518834; Mon, 03 Oct 2011 07:35:18 -0700 (PDT) Received: by 10.180.96.104 with HTTP; Mon, 3 Oct 2011 07:35:18 -0700 (PDT) In-Reply-To: <558829232.20111003133754@serebryakov.spb.ru> References: <558829232.20111003133754@serebryakov.spb.ru> Date: Mon, 3 Oct 2011 10:35:18 -0400 Message-ID: From: Ryan Stone To: lev@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Atomic increment and get? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2011 14:59:49 -0000 2011/10/3 Lev Serebryakov : > Hello, Hackers. > > =A0Is here atomic increment and get (or add and get) operation in > =A0kernel? I cannot find one. Here is atomic_add_32(), but it doesn't > =A0return result. And here is no atomic_add_64() on 32 bit system :( man atomic gives all of the atomic primitives provided in the kernel. In this case you want atomic_fetchadd_X.