I have a function that does what you want. I haven't tested it lately but it worked when I wrote it not too long ago.

(defun thread-backtrace (thread-or-id)
  "Interrupt THREAD and print a backtrace. This should not affect the thread."
  (let ((thread (etypecase thread-or-id
                  (thread thread-or-id)
                  (integer (thread-from-id thread-or-id)))))
     (let ((debug-io *debug-io*))
       (lambda () (let ((*debug-io* debug-io))
                    (sb-debug:backtrace 128)))))))

On Mon, Jan 31, 2011 at 3:42 PM, Daniel Weinreb <dlw@itasoftware.com> wrote:
I am trying to use


to execution a function in another thread.  (Specifically,
the reason I'm doing this is so that I can get a stack
trace of that thread printed.)

However, it doesn't seem to work.  Nothing
happens, unless the thread is the current thread.

Bordeax threads apparently also expects this to work.
It does not seem to be working for me.

I am using SBCL 1.0.41.ita, and uname -a is

Linux deng-dwein 2.6.27-17-generic #1 SMP Wed Jan 27 23:22:32 UTC 2010
x86_64 GNU/Linux


-- Dan

Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
Sbcl-devel mailing list