Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A439040E9 for ; Mon, 23 May 2011 10:18:17 +0000 (UTC) Received: (qmail 91689 invoked by uid 500); 23 May 2011 10:18:17 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 91651 invoked by uid 500); 23 May 2011 10:18:17 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 91643 invoked by uid 99); 23 May 2011 10:18:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 10:18:17 +0000 X-ASF-Spam-Status: No, hits=-2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Botond.Hejj@morganstanley.com designates 205.228.53.73 as permitted sender) Received: from [205.228.53.73] (HELO hqmtaint03.ms.com) (205.228.53.73) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 10:18:11 +0000 Received: from hqmtaint03.ms.com (localhost.ms.com [127.0.0.1]) by hqmtaint03.ms.com (output Postfix) with ESMTP id 16B4EB6C3EC for ; Mon, 23 May 2011 06:17:50 -0400 (EDT) X-Anti-Virus: Kaspersky Anti-Virus for Linux Mail Server 5.6.44/RELEASE, bases: 20110523 #5421588, check: 20110523 clean Received: from ny0030as02.ms.com (unknown [170.74.93.68]) by hqmtaint03.ms.com (internal Postfix) with ESMTP id 14D88A30BBB for ; Mon, 23 May 2011 06:17:50 -0400 (EDT) Received: from ny0030as02.ms.com (localhost [127.0.0.1]) by ny0030as02.ms.com (msa-out Postfix) with ESMTP id F1791AB821A for ; Mon, 23 May 2011 06:17:49 -0400 (EDT) Received: from pimsaext01.ms.com (pimsaext01 [199.89.103.70]) by ny0030as02.ms.com (mta-in Postfix) with ESMTP id EEF015CC035 for ; Mon, 23 May 2011 06:17:49 -0400 (EDT) Received: from pimsaext01.ms.com (localhost.ms.com [127.0.0.1]) by pimsaext01.ms.com (output Postfix) with ESMTP id D6B49F5A442 for ; Mon, 23 May 2011 06:17:49 -0400 (EDT) X-Anti-Virus: Kaspersky Anti-Virus for Linux Mail Server 5.6.44/RELEASE, bases: 20110523 #5421588, check: 20110523 clean Received: from mail-qw0-f41.google.com (mail-qw0-f41.google.com [209.85.216.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by pimsaext01.ms.com (submission Postfix) with ESMTPS id CAFFAF597AC for ; Mon, 23 May 2011 06:17:49 -0400 (EDT) Received: by qwa26 with SMTP id 26so3740571qwa.0 for ; Mon, 23 May 2011 03:17:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.195.201 with SMTP id ed9mr1606491qab.20.1306145869324; Mon, 23 May 2011 03:17:49 -0700 (PDT) Received: by 10.224.60.212 with HTTP; Mon, 23 May 2011 03:17:49 -0700 (PDT) In-Reply-To: References: Date: Mon, 23 May 2011 12:17:49 +0200 Message-ID: Subject: Re: compiling c client on solaris/sparc From: Botond Hejj To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=20cf300fb21790e32404a3eec8a8 --20cf300fb21790e32404a3eec8a8 Content-Type: text/plain; charset=ISO-8859-1 Hi Patrick, I see there is an asm/atomic.h on linux with atomic_add but that also doesn't look like a cross platform solution. It also have basically the same assembly code inside. Still it is probably a good idea to use that instead of the assembly. There is an atomic_add solution for solaris 10 as well but it is placed to a different directory http://graegert.com/programming/using-atomic-operations-in-c-on-solaris-10 I will look into adding this as ifdef but it wouldn't work for older solaris builds unfortunately. Thanks for the pointers, Botond On Fri, May 20, 2011 at 19:01, Patrick Hunt wrote: > Hi Botond, looking at the history for those lines it looks like that > code has been untouched since before we moved to Apache (2008). > > A quick search turned up this interesting backgrounder: > http://www.memoryhole.net/kyle/2007/05/atomic_incrementing.html > (be sure to checkout the comments on that post) > > If you'd like to submit a patch to move away from asm I don't see why > we wouldn't consider it. My concern would be that we replace it with > something that we have a high confidence will work on all platforms, > compilers, and compiler versions. Perhaps do it initially as a ifdef? > > Patrick > > On Fri, May 20, 2011 at 8:06 AM, Botond Hejj > wrote: > > Hi, > > > > I am compiling the zookeeper c client on solaris and I noticed that > > mt_adaptor.c has some assembly code in it. This makes porting to other > > platforms (sparc) difficult. What is the reason behind using assembly and > > are there any plans to change that to c code? > > > > Regards, > > Botond Hejj > > Morgan Stanley | Technology > > Lechner Odon fasor 8 | Floor 07 > > Budapest, 1095 > > Phone: +36 1 881-3962 > > Botond.Hejj@MorganStanley.com > > > -- Botond Hejj Morgan Stanley | Technology Lechner Odon fasor 8 | Floor 07 Budapest, 1095 Phone: +36 1 881-3962 Botond.Hejj@MorganStanley.com --20cf300fb21790e32404a3eec8a8--