Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Zookeeper >> mail # user >> compiling c client on solaris/sparc


Copy link to this message
-
Re: compiling c client on solaris/sparc
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 <[EMAIL PROTECTED]> 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
> <[EMAIL PROTECTED]> 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
> > [EMAIL PROTECTED]
> >
>

--
Botond Hejj
Morgan Stanley | Technology
Lechner Odon fasor 8 | Floor 07
Budapest, 1095
Phone: +36 1 881-3962
[EMAIL PROTECTED]