[plt-scheme] Interaction between Dr. Scheme and foreign libraries

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun Nov 20 22:24:49 EST 2005

I'm sorry that I can't be more help, then. You are talking to an  
extension, right? (that holds the state that isn't fresh). All I can  
imagine is that what I wrote has to somehow be made to apply to that  
extension. I doubt there is a way to do automatically in general, but  
perhaps there is a way that works in the common case. Sorry I can't  
be more help. Maybe Matthew or Eli would know better.


On Nov 20, 2005, at 9:09 PM, Ittai Balaban wrote:

> Hi.
> On Sun, 2005-11-20 at 18:58 -0600, Robby Findler wrote:
>> 1) if your state is OS-level state that can only be initialized once
>> per process, do something like what mred does when creating a
>> connection to the OS's GUI subsystem. It creates the reference  
>> once and
>> uses it multiple times and then is careful that multiple Scheme  
>> threads
>> (etc) access that shared state in a safe manner.
> I should clarify that I am not writing an extension. All I have is a
> scheme module that uses FFI to talk to an external library. Given that
> DrScheme likes to reload my module on every 'run', I don't see how  
> such
> once-created references could persist between reloads.
>> 2) if your state can safely be re-initialized, then read about
>> custodians in the mzscheme manuals (probably you want the insidemz
> This is not the case (but sounds interesting anyway).
>> In either case, it sounds like your extension is not properly set  
>> up to
>> deal with mzscheme's custodians.
> As mentioned, this is not an extension I'm dealing with. Thanks,  
> though,
> for the information.
> -- 
> Ittai
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.