[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can mzscheme do this



Currently, I am trying to use guile as an extension language to our
C/C++ based system system.  However, it appears that I'm having
problems with the garbage collection because I initialize guile in a
different thread than functions that actually call into guile use. Guile
needs control over the main loop of our program.
However, the guile functions get called on different thread created by our
gui.
Apparently, the garbage collection needs to know where the stack base
is located and that is done at initialization.  But, when gc gets
called on the ui thread, it works for awhile but eventually the
program crashes.

Should I expect similair behavior from the mzscheme extension?

Psuedo-code follows to show my predicament.

Thanks
Brian


my_function_that_calls_a_scheme_routine
{
    /* however this is being called via a different thread than boot_guile
was called */     	scm_eval_string("(callMySchemeFunction)");
}

inner_main()
{
   scm_primitive_load( "myschemefunctions.scm" );
   process_an_event_loop_with_multiple_threads(...)
}

main()
{
scm_boot_guile(... inner_main ...)