From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: doco scm_remember_upto_1 Date: 19 Jun 2003 01:36:10 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87adcf0xhx.fsf@zagadka.ping.de> References: <87wugjhowm.fsf@zip.com.au> <87wugjqx1g.fsf@raven.i.defaultvalue.org> <87r86rqa6m.fsf@raven.i.defaultvalue.org> <87vfw1i1jq.fsf@zip.com.au> <87add5mh91.fsf@zip.com.au> <87isrpjx0a.fsf@zagadka.ping.de> <877k7snrg5.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055979730 21266 80.91.224.249 (18 Jun 2003 23:42:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2003 23:42:10 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 19 01:42:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19SmZ5-0005We-00 for ; Thu, 19 Jun 2003 01:42:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19SmXf-0003qq-Nt for guile-devel@m.gmane.org; Wed, 18 Jun 2003 19:40:39 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19SmWI-0003cu-Bj for guile-devel@gnu.org; Wed, 18 Jun 2003 19:39:14 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19SmUo-0003Kk-WF for guile-devel@gnu.org; Wed, 18 Jun 2003 19:37:43 -0400 Original-Received: from mail.dokom.net ([195.253.8.218]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19SmUd-00038k-Qy for guile-devel@gnu.org; Wed, 18 Jun 2003 19:37:31 -0400 Original-Received: from dialin.speedway43.dip206.dokom.de ([195.138.43.206] helo=zagadka.ping.de) by mail.dokom.net with smtp (Exim 3.36 #3) id 19SmUq-0003tR-00 for guile-devel@gnu.org; Thu, 19 Jun 2003 01:37:44 +0200 Original-Received: (qmail 7639 invoked by uid 1000); 18 Jun 2003 23:36:10 -0000 Original-To: guile-devel@gnu.org In-Reply-To: <877k7snrg5.fsf@zip.com.au> Original-Lines: 37 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2556 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2556 Kevin Ryde writes: > In a multi-threaded program, the rule is the same. As far as a > given thread is concerned, a garbage collect still only occurs > within a memory allocation function, not at an arbitrary time. > (Guile waits for all threads to reach a memory function, and holds > them there while the collector runs.) Don't say "memory allocation function", that is too specific. A GC can occur in any libguile function, since all of them might eventually allocate memory or run a async that does so, or simply invoke SCM_TICK which is also a safe point for stopping a thread. > > But when in doubt, be > > conservative: include the call to scm_remember_upto_here_1 when > > you are not sure that it is safe to leave it out. > > I think I'd rather see something unambiguous said about when a > remember must be used, instead of talking about being unsure. I tried > to reword a little to emphasise it's memory activity which provokes a > gc. Hmm, the most concrete I can think of is: If there is a call to any libguile function after you have extracted the innards of some SCM object (from a smob, or with SCM_STRING_CHARS, etc.) you can't count on that innard still being there unless the associated SCM is used again later on (and that use is not being optimized away), if only by virtue of appearing in a call to scm_remember_upto_here. The "doubt" would come when one isn't sure whether a libguile function is being called because one doesn't know what kind of stuff third party functions do. -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel