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 Sun, 9 May 1999, Mikael Djurfeldt wrote:

> No, but there is a C call scm_spawn_thread which you can use to create
> new COOP threads in Guile from the C level.  I'm myself using it in a
> C++ program.

scm_spawn_thread (scm_catch_body_t body, void *body_data,
		  scm_catch_handler_t handler, void *handler_data)

what exactly is the type of body and handler?  One problem reading the
guile source is that a lot of types, after working through all layers of
typedefs, end up actually being either a unsigned long, a pointer to an
unsigned long, or a void pointer (all of which are pretty much
interchangable, at least on the intel platform)...

I'm not quite clear on what this function does.  Is it that it starts a
thread executing a function "body" of arguments body_data?  What is
"handler" for then? 

> There is no direct support in Guile which can be used to solve the
> problem how to keep these threads under control.

Does threaded scheme code have to do something special like call a special
function to yield its timeslice, or is this handled completely inside
guile and so I can just write code normally?

> One idea that turns up in my mind is to use some kind of watchdog
> timer: Every thread needs to do some idle calls (or calls to indicate
> that everything is OK) intermittently.  If it doesn't, another,
> special, thread will kill it.
> 
> (One problem is that there is currently no primitive to kill a thread
> from outside, but such a primitive will come in 1.3.2.)

Any idea of a release date on 1.3.2?  I'm trying to stick to official
versions (and CVS is a PITA) so I'm using 1.3 right now.

           ------------------ 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]