In Guile FFI programming, we have procedure->pointer, which makes a Scheme procedure a foreign callback. And foreign library call use this callback.
However, if this callback is called in a another foreign thread. The scheme context is not properly setup, It may cause crash or UB. IIUC, the procedure invoker "invoke_closure" defined in foreign.c doesn't use scm_with_guile. If we use scm_with_guile to make a foreign callback, would it be OK to execute Scheme procedure in multithreading context? -- Retrieve my PGP public key: gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC Zihao
signature.asc
Description: PGP signature