guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads with foreign functions


From: Joshua Judson Rosen
Subject: Re: Threads with foreign functions
Date: Wed, 29 Oct 2003 20:02:41 -0500
User-agent: Mutt/1.5.4i

On Wed, Oct 29, 2003 at 11:40:13AM +0100, Ola Leifler wrote:
> Hi!
> 
> I'm trying to control an application written in C (LGeneral by Michael 
> Speck) through Guile by using some SWIG-generated bindings that I load 
> from a dynamic library. This library is created by libtool automagically.
> 
> However, when I try to use the main function for starting the game from 
> Guile, call-with-new-thread does not return though I can see that the 
> new thread is actually running. Any ideas?

Last I heard, guile's multithreading was cooperative and
implemented in one of guile's libraries, *not* an interface to
the ambient systems's (posix) multithreading. It looks like this is
still the case.

If you put something uncooperative into one of your cooperative
threads..., uncooperability is contagious--something about C-level
calls being atomic. Maybe if you make your C-routine periodically call
guile's `scm_yield'? Or you could make it into a state-machine....

-- 
"The most hopelessly stupid man is he who is not aware that he is wise."

Attachment: pgp5waNfLfshp.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]