> > While it is absolutely possible to link everything into one process, > > that’s usually not done. > > Actually that's what I tried in the very beginning, writing a NIF to > wrap the ChackraCore API to Erlang functions. While in theory this > would be possible it's however heavily discouraged by the Erlang gods > to write NIFs with non-deterministic timing. So I quickly stepped back > from the NIF idea and instead implemented couch-chakra.
You might not have read about dirty schedulers[1] which seem to be a stable API now, & here's a few links from Steve Vinoski related to NIF handling [2][3] and some sample code [4] from Steve and from JLouis [5] using them. We already have some couchdb NIF code, and if there's a performance gain it would be great to ship some more. A+ Dave [1]: https://medium.com/@jlouis666/erlang-dirty-scheduler-overhead-6e1219dcc7#.jgdyewal6 [2]: https://www.youtube.com/watch?v=nw2eIB6bTxY [3]: https://github.com/vinoski/bitwise/blob/master/vinoski-schedulers.pdf [4]: https://github.com/vinoski/bitwise [5]: https://github.com/jlouis/enacl