unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: <dsmich@roadrunner.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: full moon, vm status update
Date: Thu, 16 Oct 2008 14:41:33 -0400	[thread overview]
Message-ID: <19165037.1374141224182493183.JavaMail.root@cdptpa-web28-z01> (raw)

---- Andy Wingo <wingo@pobox.com> wrote: 
>It seems fork + signal handling is borked with a guile compiled --with-threads -- and that's not
>specific to the vm branch.

And this is the very reason that Debian guile was built --without-threads.

It's just not a good idea to mix fork() with pthreads.  The main issue is that the child process has all the state of the parent, including the locked state of all the mutexes.  However, the threads that hold them no longer exist, so deadlocks are almost inevitable.  There is a pthread_atfork() call that should allow you to make things safe before a fork() and restore them properly afterwards.  Guile *might* be able to use this to handle all the mutexes that it creates an knows about, but what the ones a user creates in their C code, or what some C library does?

Now, this is not much of a problem with fork()+exec().    The problem is mixing "fork threading" (where you keep the same process image in the child) and posix threads. 

-Dale





             reply	other threads:[~2008-10-16 18:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 18:41 dsmich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-10-15 21:48 full moon, vm status update Andy Wingo
2008-10-16  5:35 ` Julian Graham
2008-10-16 12:34   ` Andy Wingo
2008-10-16 19:25 ` Ludovic Courtès
2008-10-16 21:21   ` Andy Wingo
2008-10-18 10:26     ` Neil Jerram
2008-10-27 23:51       ` Neil Jerram
2008-10-31 17:54         ` Andy Wingo
2008-10-31 18:36           ` Andy Wingo
2008-10-31 19:51           ` Ludovic Courtès
2008-11-08  0:24           ` Neil Jerram
2009-01-04 13:08         ` Andy Wingo

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=19165037.1374141224182493183.JavaMail.root@cdptpa-web28-z01 \
    --to=dsmich@roadrunner.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).