github / brubeck

A Statsd-compatible metrics aggregator
MIT License
1.19k stars 94 forks source link

use compiler intrinsics instead of asm #4

Closed haneefmubarak closed 9 years ago

haneefmubarak commented 9 years ago

Used compiled intrinsics where possible and added instructions for other architectures. I also changed the cpu_relax() macro to work across architectures and actually yield accesses to other cores when possible (x86(_64), Power{PC,1,2,3,4,5,6,7,8}, ARMv6T2+, ARM64).

Tested to compile cleanly on:

haneefmubarak commented 9 years ago

@vmg is there a CLA I need to sign (cause I noted your incredulity in #6)?

vmg commented 9 years ago

@haneefmubarak Indeed. Can you please sign right here? I hope the link works. ^^

vmg commented 9 years ago

Ooops! While reviewing your PR (which by the way looks correct), I've noticed that atomic.h is not used anywhere in the codebase. Silly me! It's a leftover from a really old version of Brubeck. Atomic operations are defined in util.h using compiler intrinsics, just like this PR does.

I've opened https://github.com/github/brubeck/pull/10 to remove this file altogether. Sorry for wasting your time! :(

haneefmubarak commented 9 years ago

:cry:

Oh well, it appears that the same mior issues exist in util.h, so I'll try to make the amendments work there.