[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Unable to make threads from scm_c_primitive_load'ed files/Previously scm
From: |
Remco Bras |
Subject: |
Unable to make threads from scm_c_primitive_load'ed files/Previously scm_c_define_gsubr-defined values unbound in new threads |
Date: |
Sat, 8 Mar 2008 17:53:32 +0100 |
User-agent: |
KMail/1.9.6 (enterprise 0.20070907.709405) |
Hello,
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. 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.
Since I had to be able to load files in new threads rather than the current, I
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.
Is there any way to do either (make-thread load filename) or something
equivalent in scripts loaded with scm_c_primitive_load?
Thanks in advance for your time,
Remco Bras.
backtrace.txt
Description: Text document
guile.c
Description: Text Data
- Unable to make threads from scm_c_primitive_load'ed files/Previously scm_c_define_gsubr-defined values unbound in new threads,
Remco Bras <=