[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unable to make threads from scm_c_primitive_load'ed files/Previously
Re: Unable to make threads from scm_c_primitive_load'ed files/Previously scm_c_define_gsubr-defined values unbound in new threads
Sat, 08 Mar 2008 21:39:45 +0000
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)
Thanks for your email...
Remco Bras <address@hidden> writes:
> I have run into a double problem with guile, that has to do with threads. The
> situation is roughly as follows. First, scm_init_guile is called from one
> thread, after which scm_c_define_gsubr is used in that thread and
> scm_c_primitive_load is called to load several files. The first problem I
> have encountered is that make-thread is unbound when evaluating the code in
> the files I load, making it impossible to make threads this way.
That might be resolved by adding (use-modules (ice-9 threads)) to the
start of the code that calls make-thread. Can you try that?
> Other ways
> to spawn threads fail as well. For example, (call-with-new-thread (lambda ()
> (load "keys.scm"))) fails with a SIGSEGV. The attachment backtrace.txt
> contains a backtrace of this particular failure.
Note that the backtrace is describing a Scheme-level error, not a
SIGSEGV. Are you saying that there was a SIGSEGV as well?
Anyway, the backtrace implies, I think, that the current-load-port had
previously been set to stdin, and that stdin has been closed. Would
that make sense in your program?
> Since I had to be able to load files in new threads rather than the current,
> tried doing so with a C function, exposed to Scheme with scm_c_define_gsubr.
> The function, in case that is important, is included in the attached file
> guile.c. Doing things this way succeeds in creating threads, but once it
> attempts to evaluate any code in the file, it fails because the procedures I
> previously defined with scm_c_define_gsubr() are unbound.
Are you able to post (a link to) your complete program? I'm not sure
I'm understanding everything from your description here.