unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Killing off scm_init_guile for Guile 2.0 ?
@ 2009-01-15 23:30 Neil Jerram
  2009-01-15 23:48 ` Neil Jerram
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Neil Jerram @ 2009-01-15 23:30 UTC (permalink / raw)
  To: guile-devel, Guile User

scm_init_guile has always been a bit problematic, as it requires lots
of heuristic and OS-dependent code to try to determine where the base
of the stack is.  It's never been formally deprecated, but we have
always advised people to use scm_boot_guile or scm_with_guile if they
can, and the manual says:

     The function `scm_init_guile' might not be available on all
     platforms since it requires some stack-bounds-finding magic that
     might not have been ported to all platforms that Guile runs on.
     Thus, if you can, it is better to use `scm_with_guile' or its
     variation `scm_boot_guile' instead of this function.

Now I've found another problem with it (while investigating Greg's
NetBSD "unlocking unlocked mutex" report), so I'm wondering if it's
time now (i.e. in Guile 2.0) to remove it.  Can you respond to this
thread if you think you would be inconvenienced by this, or are aware
of a library or application that currently uses scm_init_guile ?

The problem is that if a thread is initialized (for Guile) by calling
scm_init_guile, Guile doesn't push a cleanup function for it.  This
means that if that thread is later terminated while in Guile mode, it
will die holding its "heap" mutex, and sooner or later (at the next
GC) that will cause all other Guile processing to hang.  It isn't
possible for scm_init_guile to push a cleanup function, because the
pthreads API requires pthread_cleanup_push () and pthread_cleanup_pop
() to be paired in the same lexical scope.

Thoughts?  On the other hand, does moving to BDW-GC take a lot of this
out of our hands anyway?  In any case, it would be interesting to hear
whether people think that scm_init_guile is really needed.

Regards,
       Neil




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-01-23 16:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-15 23:30 Killing off scm_init_guile for Guile 2.0 ? Neil Jerram
2009-01-15 23:48 ` Neil Jerram
2009-01-16 14:57   ` Ludovic Courtès
2009-01-16  3:59 ` Linas Vepstas
2009-01-16 15:00   ` Ludovic Courtès
2009-01-16 15:41     ` Bill Schottstaedt
2009-01-23  1:49   ` Neil Jerram
2009-01-16 21:32 ` dsmich
2009-01-17  1:36   ` Linas Vepstas
2009-01-21 21:52     ` Zeeshan Ali (Khattak)
2009-01-23  2:02     ` Neil Jerram
2009-01-23  6:13       ` Clinton Ebadi
2009-01-23 16:23         ` Ludovic Courtès
2009-01-23 16:21       ` Ludovic Courtès

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).