Hi, I'm excited to announce the first release of POSIXClock, a package that provides Julia bindings to clock_*() functions from POSIX real-time extensions (librt on Linux). https://github.com/ibadr/POSIXClock.jl
But first, a full disclosure: I'm very new to Julia programming as well as to real-time programming. That being said, I think this first release is working as expected, and I tested it on a laptop powered by Intel Celeron processor running Julia v0.4.5 as well as on a BeagleBone Black board powered by AM335x armv7-based processor running Julia v0.5.0-dev nightly build. The focus of the first release was on showing a proof-of-concept demonstration that it's possible to execute hard real-time Julia code, with emphasis on wrapping the clock_gettime() and the clock_nanosleep() functions using CLOCK_MONOTONIC and absolute-time sleeps. Special care was devoted to completely avoiding memory allocations in the real-time section of the code by using in-place operations and pre-allocating all the needed variables, as well as by disabling the garbage collector. The latency histogram (see README.md) demonstrates such hard real-time functionality, with worst-case latency of 40 us on a simple Intel Celeron processor. A similar histogram was obtained for the BeagleBone Black, albeit with worst-case latency of up to 140 us. This package should appeal to roboticists interested in Julia (I have successfully tested this package with blinking a GPIO on the BeagleBone Black using the mraa library), as well as to scientists conducting closed-loop experiments with soft or hard real-time requirements. (Hard real-time performance requires a recent Linux kernel with the PREEMPT_RT patch.) In addition to this announcement, I have a couple of questions pertaining to best practices for writing real-time Julia code and avoiding memory allocations, as well as to sharing arrays between two Julia instances (one is real-time and the other is regular). Is it best to post these questions in this thread, or to create a new thread for these questions? Cheers, Islam