C++ Memory Model: Migrating from x86 to ARM

Estimated reading time: 18 minutes

Over the past years, we have seen a shift in processors from the previously dominant x86 architecture to the more energy-efficient (and often cheaper) ARM architecture. This trend is true for both consumer hardware, e.g., Apple’s M1 SoC and also server hardware, e.g. AWS’s Gravitron processor. Given that the ARM architecture has a more relaxed memory model, this might have some subtle impact on C++ programs…

With the introduction of multi-threaded execution in C++11, the standard also introduced a memory model. For many developers, this memory model is one of the least well-understood parts of the C++ standard and a common source of confusion. While an in-depth explanation of the C++ memory model is beyond this blog post’s scope, we will cover some basics and take a brief look at two of the most common hardware memory models and how the C++ memory model maps to these hardware models.

But first, let’s take a step back and consider why we need a memory model in the first place.

(more…)
More info...

MERII Hummingbird A80 Optimus Cluster: ArangoDB Deployment

For running ArangoDB in clusters doing performance tests we wanted to have a non virtualized set of descent hardware with fast ethernet connection, enough RAM (since thats what Arango needs) and multicore CPU. Since you need a bunch of them, cheap ARM devel boards come to mind. The original Raspberry PI (we have those) is out of the game due to V8 is not supporting it anymore. The now available PI 2 doesn’t cut it, since its ethernet NIC is connected via USB (as on the original PI). The Odroid series only have one of both: Fast ethernet or enough RAM. The Cubieboard 4 wasn’t available yet, but its Allwinner A80 SOC seemed a good choice. Then we met the Merii Optimus board, which seems to be almost the same as the PCDuino (now renamed to Arches) with the A80. While we got a bunch of them for a descent price over at Pollin, the upstream support wasn’t that good.

However, with some help of the SunXi-Linux Project we started flashing OS images to replace the preloaded Android image with the Merii Linux image. Since the userland of the Merii image is pretty sparse, we wanted something more useable. There is already a how-to on running Ubuntu which requires running a Windows host. We prefer a Linux host and want to run a Debian. Since the new Pi2 is also able to run regular Debian with ArmV7, we pick the root fs from sjoerd.

IMG_7640 (more…)

More info...

ArangoDB 2.2.5 Release: Enhancements & Bug Fixes

This version is deprecated. Download the new version of ArangoDB

A maintenance release for ArangoDB 2.2 is available from the usual channels. v2.2.5 (2014-10-09) ——————-
* fixed issue #961: allow non-JSON values in undocument request bodies
* fixed issue 1028: libicu is now statically linked
* fixed cached lookups of collections on the server, which may have caused spurious   problems after collection rename operations

More info...

ArangoDB 1.4.0 on Raspberry Pi: Database Power for Small Devices

This is a follow to the post about ArangoDB 1.3 running on Raspberry PI. With the release of ArangoDB 1.4.0 I now tried to compile it again. As all patches required for 1.3 are part of 1.4.0 it is now much easier.

  pi> sudo apt-get install libreadline6 libreadline6-dev libssl-dev
  pi> git clone -b v1.4.0 https://github.com/triAGENS/ArangoDB
  pi> cd ArangoDB
  pi> ./configure --enable-all-in-one-icu --enable-all-in-one-v8 --enable-all-in-one-libev --disable-mruby
  pi> make

After a few hours, everything (including V8 & ICU) is compiled and you can start ArangoDB on a raspberry

  pi> mkdir /tmp/testbase
  pi> ./bin/arangod -c etc/relative/arangod.conf /tmp/testbase

and the shell in another window

  pi> ./bin/arangosh -c etc/relative/arangosh.conf

or point your browser to http://pi:8529/

However, if you do not want to wait for hours, I’ve tried to build a debian package, which can be downloaded from here:

    pi> wget http://www.arangodb.com/repositories/raspbian/arangodb-1.4.0-raspbian.deb
    pi> sudo dpkg -i arangodb-1.4.0-raspbian.deb

This has not been tested in detail. So any feedback or improvements are welcome.

More info...

Get the latest tutorials,
blog posts and news: