[cp-patches] FYI: Add remaining missing Thread methods

Andrew John Hughes A.Hughes at dcs.shef.ac.uk
Wed Jun 28 10:07:14 UTC 2006

On Wed, 28 Jun 2006 10:52:13 +0200
"Jeroen Frijters" <jeroen at sumatra.nl> 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

> Regards,
> Jeroen

Andrew :-)

Department of Computer Science
University of Sheffield

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20060628/8895842f/attachment.pgp

More information about the Classpath-patches mailing list