For a few weeks now I’ve been working on writing Ruby bindings to FMOD, and I actually managed to get callbacks working.
Ruby is extremely fussy about running Ruby code on threads not made by Ruby, like the threads FMOD uses to run callbacks, so I ended up setting up a system that runs FMOD callbacks in a Ruby thread. (It requests that the Ruby thread runs a callback and then waits for that callback to finish.)
Unfortunately, this means that the callback blocks until Ruby gets around to running it (Ruby does not support true multithreading- only one thread can actually execute at a time) which can take a while in comparison to callbacks FMOD is designed to be running.
I haven’t seen any negatives from doing this, however I may be wrong and I’d like to know if there are any?