From: "Henri Häkkinen" <henri.hakkinen@pp2.inet.fi>
To: guile-user@gnu.org
Subject: multi-threading
Date: Sun, 06 Jul 2008 01:14:19 +0300 [thread overview]
Message-ID: <486FF23B.6000301@pp2.inet.fi> (raw)
Hello,
I am trying to use Guile from an multi-threaded application. Here is a
sample code:
// test.c
#include <libguile.h>
#include <pthread.h>
static void *
inner_thread (void *p)
{
scm_c_eval_string ("(newline)");
return NULL;
}
static void *
thread (void *p)
{
return scm_with_guile (inner_thread, p);
}
static void
inner_main (void *closure, int argc, char **argv)
{
pthread_t thr;
pthread_create (&thr, NULL, thread, NULL);
pthread_join (thr, NULL);
}
int
main (int argc, char **argv)
{
scm_boot_guile (argc, argv, inner_main, NULL);
return 0;
}
I have read from the Guile manual that I should be able to use threads
in this way. However, I get ERROR: Stack overflow. Do you know where is
the problem? Running `guile --version` returns "Guile 1.8.1".
--
Henri Häkkinen
next reply other threads:[~2008-07-05 22:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 22:14 Henri Häkkinen [this message]
2008-07-05 22:34 ` multi-threading Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=486FF23B.6000301@pp2.inet.fi \
--to=henri.hakkinen@pp2.inet.fi \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).