Open eschnett opened 6 months ago
I am calling Julia from C++ in kotekan, independent of jluna. (I was not aware of jluna when I implemented this.) kotekan is multi-threaded.
To support multi-threading, kotekan is using the following approach:
A "task" is a std::function<void(void)> wrapping a closure. A std::future is used to return the value from Julia to the calling thread.
std::function<void(void)>
std::future
See https://github.com/kotekan/kotekan/blob/1b930517ab9fbc71cbc02a787af197a316627a09/lib/core/juliaManager.hpp and https://github.com/kotekan/kotekan/blob/1b930517ab9fbc71cbc02a787af197a316627a09/lib/core/juliaManager.cpp for the implementation in kotekan. A similar implementation would be possible for jluna.
I am calling Julia from C++ in kotekan, independent of jluna. (I was not aware of jluna when I implemented this.) kotekan is multi-threaded.
To support multi-threading, kotekan is using the following approach:
A "task" is a
std::function<void(void)>
wrapping a closure. Astd::future
is used to return the value from Julia to the calling thread.See https://github.com/kotekan/kotekan/blob/1b930517ab9fbc71cbc02a787af197a316627a09/lib/core/juliaManager.hpp and https://github.com/kotekan/kotekan/blob/1b930517ab9fbc71cbc02a787af197a316627a09/lib/core/juliaManager.cpp for the implementation in kotekan. A similar implementation would be possible for jluna.