On Wed, 28 Jun 2006 10:52:13 +0200 "Jeroen Frijters" <[EMAIL PROTECTED]> wrote:
> Andrew John Hughes wrote: > > The attached patch adds the two missing stack trace methods to > > Thread. Currently, they are untested, as nothing yet implements > > the new VM method for thread stacktraces. > > Thanks! It doesn't yet work, as ManagementFactory.getThreadMXBean() is > currently still unimplemented. > Yes, that's next in line :) > > On that note, if there is some way we can reuse the existing stack > > trace stuff, let me know. I'm not sure how it respects individual > > threads at present. > > I don't think so and the problems are somewhat different too. Obtaining > the stack trace of the current thread is (a little) easier than that of > an arbitrary thread (where you have to suspend the thread to be able to > safely walk the stack). > Yes, I don't think so either; the current stack tracing appears to be limited to Throwables. I assume some VMs already have something close to this stuff though, as, IIRC, you can do Ctrl-D or something and getting a listing of the current threads. You don't need to suspend the thread, as the documentation explicitly says that the thread can be running when this takes place (although this obviously leads to unreliable results). I don't think any of these are meant to be a perfect evaluation of the current state. getAllStackTraces(), for instance, will give traces for several threads, but all at different times (as they are taken sequentially). > Regards, > Jeroen > Thanks, -- Andrew :-) Department of Computer Science University of Sheffield http://www.dcs.shef.ac.uk/~andrew
pgpWrjYVEpfLH.pgp
Description: PGP signature
