guile-user
[Top][All Lists]
Advanced

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

multi-threading


From: Henri Häkkinen
Subject: multi-threading
Date: Sun, 06 Jul 2008 01:14:19 +0300
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

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




reply via email to

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