[gambit-list] Gambit linking

Marc Feeley feeley at iro.umontreal.ca
Wed Nov 6 10:25:58 EST 2013


On Nov 5, 2013, at 11:58 PM, Dimitris Vyzovitis <vyzo at hackzen.org> wrote:

> Is it really necessary?

As I said, the current linking model could be kept, but this would require a convoluted main program logic.  Each VM would basically boot by "loading" the same set of modules, and the main program logic would have to do a dispatch on the VM identifier (small integer?) to select the appropriate behavior for that VM.

> 
> Why not handle module loading in the primordial thread, which would be the first boot thread for global data structures and then the boot thread per VM for concurrent initialization.
> 
> The programmer can then load modules explicitly per VM. All that is needed is an API to select the target VM.

I'm not against a Scheme level API to initialize the target VM.  What I proposed in my message is to add module dependencies so that initialization can be driven by the specific needs of a VM's main module.

> 
> -- vyzo
> 
> PS: a performance related suggestion: use __thread for TLS with gcc/glibc if you are planning a 1-1 VM to OS thread mapping (instead of pthread tls).

Yes, that's already in place for accessing the context of a VM (when the C compiler supports it, such as gcc).

Marc




More information about the Gambit-list mailing list