This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++ -> guile threading



On Fri, 7 May 1999, Greg Harvey wrote:

> Peter Amstutz <tetron@student.umass.edu> writes:
> 
> > The server part of this apps is going to serve many users at once.  Users
> > will be able to upload bits of their own scheme to automate server
> > tasks.
> 
> This is sort of a large, drooling security hole.

This brings up a seperate question then:  how do I start up a "blank"
guile system - one with a nearly bare environment that's just keywords
(define, let, if, lambda, etc...) so I can just allow in library calls
(both my own and some standard scheme) deemed to be safe?

> OS level threads aren't currently supported. There has been some work
> (there's an initial pthreads patch, linked from the projects list at
> http://home.thezone.net/~gharvey/guile/guile-projects.html
> but there are still issues that need to be resolved in guile to make
> it play nice with os threads).

Uh, sounds messy...  What I am considering now is threading just the C,
and putting the guile system in one thread and having a queue of "scheme
requests"...  Basically batch processing scripting stuff in a single
thread but still in-processes so to have easy access to data structures.
It seems most doable at the moment.
 
> > The other option would be to write a single-threaded app and somehow limit
> > the amount of time that a user's code can spend in the guile system, but I
> > don't know how I would go about interrupting and canceling execution like
> > so...  Perhaps setting and alarm and catching the signal, but is there a
> > scm_??? function that cause guile to drop everything and return that would
> > be callable from a signal handler?
> 
> You should be able to do this with asyncs (see async.c in the libguile
> directory). The source file contains some documentation on how to use
> them, and instructions on how to use them from unix signal handlers (I
> have partial written documentation on this, but there are a few bits I
> still need to figure out, so it's not available yet).

It's pretty vague...  A bit of example code showing what/how this
works would be quite enlightening :)

           ------------------ Peter Amstutz --------------------
           -------------- tetron@student.umass.edu -------------
           ------- http://www-unix.oit.umass.edu/~tetron -------
           -----------------------------------------------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]