bugGuile - Bugs: bug #27457, Threads, mutexes, and critical...

 
 

bug #27457: Threads, mutexes, and critical sections

Submitter:  Ludovic Courtès <civodul>
Submitted:  Tue 15 Sep 2009 11:33:00 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 May 2010 09:45:09 PM UTC, comment #1: 

I can't reproduce the problem with 1.9.10 where `throw' is now implemented in Scheme, which scm_ithrow () simply invokes.

IOW, this bug is obsolete.  :-)

Ludovic Courtès <civodul>
Group administrator
Tue 15 Sep 2009 11:33:00 PM UTC, original submission:  

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

Ludovic Courtès <civodul>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by civodul (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-11 civodul StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code