unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Linas Vepstas" <linasvepstas@gmail.com>
To: "Andy Wingo" <wingo@pobox.com>
Cc: bug-guile@gnu.org, guile-devel@gnu.org
Subject: Re: Does anyone actually use threads with guile?
Date: Thu, 13 Nov 2008 16:56:46 -0600	[thread overview]
Message-ID: <3ae3aa420811131456m6aaa88efs43a709a5ced981f4__19826.1500140235$1226880891$gmane$org@mail.gmail.com> (raw)
In-Reply-To: <m363mr9wwb.fsf@pobox.com>

2008/11/13 Andy Wingo <wingo@pobox.com>:
> For my part I apologize for not having the cycles

Fine, I'm hacking around it for now, but would like to see
something for 1.8.6.

> On Thu 13 Nov 2008 05:56, "Linas Vepstas" <linasvepstas@gmail.com> writes:
>
>> Basically, at any given time, some thread might be
>> in a critical section. Some other thread may be
>> throwing an error for some utterly unrelated reason.
>> Yet, when the error is thrown, this "critical section"
>> check will trip, and it will do so for an utterly bogus
>> reason.  At least, that describes my case.
>>
>> Is there any reason at all not to remove this check
>> entirely? (at  libguile/throw.c line 695.)
>
> I think the idea behind the check sounds good -- it is incorrect to
> throw from within a critical section, and the check detects this.
>
> But the check is incorrect as you noticed, it should be checking if the
> current thread is in a critical section.

The patch below does this.

I do not understand how 'async' fits into the grand scheme
of things. From what I can tell, though, there won't be any
cases where the thrower will be in a different thread than
where scm_ithrow() will run.  So the patch should be good.

--linas

---
 libguile/throw.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: guile-1.8.5/libguile/throw.c
===================================================================
--- guile-1.8.5.orig/libguile/throw.c  2008-11-13 16:02:26.000000000 -0600
+++ guile-1.8.5/libguile/throw.c 2008-11-13 16:29:46.000000000 -0600
@@ -689,7 +689,7 @@ scm_ithrow (SCM key, SCM args, int noret
   SCM dynpair = SCM_UNDEFINED;
   SCM winds;

-  if (scm_i_critical_section_level)
+  if (SCM_I_CURRENT_THREAD->block_asyncs)
     {
       fprintf (stderr, "throw from within critical section.\n");
       abort ();




  parent reply	other threads:[~2008-11-13 22:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3ae3aa420811122028w3c069b88q93a8290385188f79@mail.gmail.com>
2008-11-13  4:56 ` Does anyone actually use threads with guile? Linas Vepstas
2008-11-13 20:46   ` Andy Wingo
2008-11-13 22:44     ` Critical sections Ludovic Courtès
2008-11-13 22:56     ` Linas Vepstas [this message]
2008-11-17 13:09   ` Does anyone actually use threads with guile? Han-Wen Nienhuys

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='3ae3aa420811131456m6aaa88efs43a709a5ced981f4__19826.1500140235$1226880891$gmane$org@mail.gmail.com' \
    --to=linasvepstas@gmail.com \
    --cc=bug-guile@gnu.org \
    --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).