[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-help
Subject:    [Sbcl-help] SBCL threads not always quitting on QUIT signal
From:       Kristoffer Kvello <kristoffer.kvello () gmail ! com>
Date:       2007-06-29 5:21:12
Message-ID: 46849f70.1e35440a.37c4.ffffead2 () mx ! google ! com
[Download RAW message or body]

Hello,

I wanted to see if I could connect with SLIME to a running 
multi-threaded application in SBCL and debug any threads that had had 
an error signaled in them. To my delight I found that I could, but I 
also noticed that some threads did not respond either to a debug or a 
terminate request.

Experimenting with creating and terminating threads in SBCL started 
from a shell (i.e. not with SLIME) showed that some threads will not 
terminate, and it appears that the interrupt request is received by 
them but not acted upon (see transcript below).

Is this a bug or am I doing something wrong?

Thanks,


Kristoffer

----------

kristoffer@linux:~> uname -a
Linux linux 2.6.11.4-21.10-default #1 Tue Nov 29 14:32:49 UTC 2005 
i686 i686 i386 GNU/Linux
kristoffer@linux:~> sbcl --no-userinit
This is SBCL 1.0.7, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (use-package :sb-thread)

T
* (loop repeat 3 do (make-thread (lambda () (error "haha")) :name 
(random 1000)))

debugger invoked on a SIMPLE-ERROR in thread #<THREAD 254 {A6D1CA9}>: haha

debugger invoked on a SIMPLE-ERROR in thread #<THREAD 504 {A6D1D61}>: haha

NIL
*
debugger invoked on a SIMPLE-ERROR in thread #<THREAD 500 {A6D1E19}>: haha
(list-all-threads)

(#<THREAD 500 {A6D1E19}> #<THREAD 504 {A6D1D61}> #<THREAD 254 {A6D1CA9}>
  #<THREAD "initial thread" {A69E721}>)
* (terminate-thread (first *))

NIL
* (terminate-thread (second **))

NIL
* (terminate-thread (third ***))

NIL
* (list-all-threads)

(#<THREAD 500 {A6D1E19}> #<THREAD "initial thread" {A69E721}>)
* (terminate-thread (first *))

NIL
* (list-all-threads)

(#<THREAD 500 {A6D1E19}> #<THREAD "initial thread" {A69E721}>)
* (describe (first *))

#<THREAD 500 {A6D1E19}> is an instance of class #<STRUCTURE-CLASS THREAD>.
The following slots have :INSTANCE allocation:
  NAME                  500
  %ALIVE-P              T
  OS-THREAD             1093036960
  INTERRUPTIONS         (QUIT QUIT)
  INTERRUPTIONS-LOCK    #S(MUTEX :NAME "thread interruptions lock" :VALUE NIL)
  RESULT                NIL
  RESULT-LOCK           #S(MUTEX
                           :NAME "thread result lock"
                           :VALUE #<THREAD 500 {A6D1E19}>)
*


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sbcl-help mailing list
Sbcl-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic