bug-guile
[Top][All Lists]
Advanced

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

[bug #27457] Threads, mutexes, and critical sections


From: Ludovic Courtès
Subject: [bug #27457] Threads, mutexes, and critical sections
Date: Tue, 15 Sep 2009 23:33:01 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090912 IceCat/3.5.3

URL:
  <http://savannah.gnu.org/bugs/?27457>

                 Summary: Threads, mutexes, and critical sections
                 Project: Guile
            Submitted by: civodul
            Submitted on: Tue 15 Sep 2009 11:33:00 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

With Guile 1.9.3, the test case below eventually leads to "throw from within
critical section" errors (that's on a dual-core).

#v+
(use-modules (srfi srfi-18))

(let loop ()
  (display ".")
  (let ((t (make-thread (lambda () #t) 'thread-join-3)))
    (thread-start! t)
    (false-if-exception (throw 'x)))

  (loop))
#v-

First, it's worth noting that `scm_ithrow ()' and `scm_dynthrow ()', which
produce this kind of error, are sloppy.  To be less sloppy, they should use a
memory barrier (as introduced by, e.g., GCC's `__sync_fetch_and_add ()'
built-in), just like `SCM_CRITICAL_SECTION_{START,END}'.  But apparently
that's not enough.

Presumably, it would also help if the queue primitives in `threads.c' didn't
use the critical section macros.

Thanks,
Ludo'.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27457>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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