[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does anyone actually use threads with guile?

From: Linas Vepstas
Subject: Re: Does anyone actually use threads with guile?
Date: Thu, 13 Nov 2008 16:56:46 -0600

2008/11/13 Andy Wingo <address@hidden>:
> 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" <address@hidden> 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.


 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 ();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]