This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: c++ -> guile threading
- To: Greg Harvey <Greg.Harvey@thezone.net>
- Subject: Re: c++ -> guile threading
- From: Peter Amstutz <tetron@student.umass.edu>
- Date: Mon, 10 May 1999 02:45:29 -0400 (EDT)
- cc: guile@cygnus.com
- Reply-To: tetron@student.umass.edu
On Sat, 8 May 1999, Greg Harvey wrote:
> It's a bit contorted, which is why a new environment representation
> was proposed ;). A sample of fetching all the available symbols in a
> module can be found in the apropos code in the session module.
>
> Basically, what you want is something like:
>
> (define-module (user-code-module))
>
> (define eval #f)
> (define load #f)
> ...
>
> And all user code would be run in the user-code-module.
>
> My thinking is that with a more flexible system of environments, there
> will probably be support at the guile level for safe vs. full bindings
> (it is, in fact, possible right now, it just hasn't been done
> yet). You could totally blank things out doing:
>
> (set-module-uses! (current-module) '())
I was just playing with modules and I'm really confused as to how they
work, and I've been pouring over the ice-9 scheme source for the module
system for a while. Are there any documents or example code showing how
to use modules to restrict certain pieces of code while still allowing
others to work? I looks like what I'll be doing is having a bit of master
scheme code taking code snippits and then creating scheme threads to
execute said snippts... however the controlling thread-creating thread has
to have some access to stuff that the spawned off new threads don't...
Oh and by the way, is it necessary to use (thread-join) to release a
scheme thread's control structure like pthread_join in C? If you don't do
it in C, you get a slow memory leak. Since this is lisp, you'd think it
might be GC'd but you never know...
It looks like things are shaping up... If I can just figure out how to
use the module system to deny access to naughty functions then I'll have
pretty much solved all the current-guile-technology related issues with my
program :) (and actually get on and start writing the damn thing...)
------------------ Peter Amstutz --------------------
-------------- tetron@student.umass.edu -------------
------- http://www-unix.oit.umass.edu/~tetron -------
-----------------------------------------------------