unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
Subject: threads from outside guile
Date: 22 Oct 2003 21:04:10 +0100	[thread overview]
Message-ID: <87y8vdhwed.fsf@kanga.tapsellferrier.co.uk> (raw)

I've written an HTTP server for guile/scheme. I want to use
threads. I want to create the threads from C (there are good reasons
for these decisions, believe me).

In effect what I want to do is this:


server.c

main ()
{
  init_guile();
  for (i = 0; i < 100; i++)
    make_thread(handler);
}

handler ()
{
  while (1)
    {
       get_mutex_lock();
       soc = accept(socket);
       release_mutex_lock();
       call_scheme_function(soc);
    }
}


I could do this kind of thing with Python, though the C pthreads would
have to register themselves with Python first.

The current trunk guile doesn't seem to work with threads created
outisde of guile and it isn't immediately obvious whether it's
possible to do at all...

I have worked my way through a little of the code, it seems like I'm
getting an exception in the garbage collector (but I'm not really
sure).


Can anyone give me a clue as to whether guile is supposed to support
threads created outside of the scheme environment?

If so are they expected to register with guile in some way?

If not, any basic overview of how I might add a registration system?



Nic Ferrier



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


                 reply	other threads:[~2003-10-22 20:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87y8vdhwed.fsf@kanga.tapsellferrier.co.uk \
    --to=nferrier@tapsellferrier.co.uk \
    /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).