The correct answer is probably "try it"; but I just want to see if there are non-deterministic gotchas I need to be aware of.
I have the following setup in mind:
I have C++ ffi that create threads. Real Linux OS threads.
So I startup gambit gsi (in OS thread 0) ; it calls the C++ ffi code; creating linus OS thread (OS Thread 1) in the same address space.
OS Thread 1 never makes any calls to gambit. Thread 0 & Thread 1 do not have any race conditions in C++ land.
Are there any other gotchas I should worry about, or am I relatively safe?
Months ago, I was complaining about gc pauses; well now, I've moved rendering entirely into C++ land with it's own thread and all that. Now, I'm thinking of bringing gambit back in.
In particular, I'm planning on using the pthreads library.
Thanks!
Afficher les réponses par date
gotchas I need to be aware of.
Make sure you don't pass movable Scheme objects to other threads (by putting them through the |scheme-object| ffi type). ___STILL objects should be fine (as long as their refcount isn't zero).
There's a pthread example in the Gambit distribution.
Christian.