* guile and pthreads again
@ 2004-04-21 21:16 Julian Graham
2004-05-17 21:05 ` Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: Julian Graham @ 2004-04-21 21:16 UTC (permalink / raw)
Hi everyone,
I know this has been addressed several times before, but I haven't been
able to find a satisfactory explanation in the docs, mailing list, or
newsgroups. I'm using Guile 1.6.4 as an embedded interpreter of user code
in a multithreaded (via pthreads) server program I'm writing. I understand
that in order to portably examine the stack, Guile must be launched in a
stack frame below the ones in which it is used. Will this work in my
program, in which I am routinely starting new threads as users connect? It
seems like there have been some problems in previous versions that have
since been resolved, possibly via the introduction of the scm_spawn_thread
function.
I'm a little leary of using it, however, since a) there's no documentation
for it as far as I can tell (in general I have a hard time telling whether
the documentation is talking about OS threads or Scheme threads); and b) it
takes Guile-defined types as arguments and returns a SCM. For what it's
worth, I'm not interested (as yet) in threads of Scheme code being launched
by Scheme or C code, only in multiple threads of my C code being able to
call functions in Guile's C API. It would be okay if I had to lock some
kind of Guile mutex in order do this. It would even be okay if each thread
had to have its own Guile 'instance', since I'd like to have them evaluate
expressions pretty much in isolation from each other.
Finally, provided scm_spawn_thread or some other pthread-replacing code is
necessary, how will this play with regular pthread operations, such as
joining and cancelling? Will the cancel function for a Guile-aware thread
also be Guile-aware so that it can, for example, unprotect a previously
GC-protected object? Will the garbage collector then be able to free such
memory once the cancel function exits and the thread has been destroyed? Is
there a more comprehensive set of documentation, in CVS, maybe, that makes
this clearer?
Apologies if any of this is covered in some obviously place...
Thanks in advance,
Julian
_________________________________________________________________
>From must-see cities to the best beaches, plan a getaway with the Spring
Travel Guide! http://special.msn.com/local/springtravel.armx
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: guile and pthreads again
2004-04-21 21:16 guile and pthreads again Julian Graham
@ 2004-05-17 21:05 ` Marius Vollmer
0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2004-05-17 21:05 UTC (permalink / raw)
Cc: guile-user
"Julian Graham" <grahamjar@hotmail.com> writes:
> Apologies if any of this is covered in some obviously place...
I don't think it is adequately covered yet, unfortunately. It will be
in the 1.8 release...
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-05-17 21:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-21 21:16 guile and pthreads again Julian Graham
2004-05-17 21:05 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).