Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Threading troubles  (Read 748 times)
0 Members and 2 Guests are viewing this topic.
Offline endolf
« League of Dukes »

JGO Kernel
*****

Posts: 1597
Medals: 2


Current project release date: sometime in 3003


« on: 2003-12-12 05:08:40 »

Ok, first thing, this is work related (I get an excuse to check the forums at work now Smiley), if you don't like work related questsion on forums, please exit now Smiley.

A while back there was a topic to do with getting the stack trace from an active thread group. I'm faced with a problem where I need to find and count all the threads in a group that are in the wait() method, and maybe process what it is they are waiting on. I've seen this when doing a ctrl-break and see the wait and the lock listed, what I would like is a programatic way to do this, or some other way to find the threads that are in wait state. I tried searching for the thread but didn't find it, I guess I got the wrong keywords/author.
Any ideas ?

Cheers

Endolf

(I was going to post this in newless cluebies, but It's got nowt to do with games and the forum heading for this one is 'Talk about non game development topics here! ', and this aint game dev Smiley)

Offline oNyx

JGO Kernel
*****

Posts: 2943
Medals: 5


pixels! :x


« Reply #1 on: 2003-12-12 05:22:32 »

I think you mean that thread:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1063619239;start=19#19

Thread.dumpStack() <- That one right? Smiley

弾幕 ☆ @mahonnaiseblog
Offline endolf
« League of Dukes »

JGO Kernel
*****

Posts: 1597
Medals: 2


Current project release date: sometime in 3003


« Reply #2 on: 2003-12-12 05:34:37 »

Hi
 I'm not sure it was, it was a while ago so I don't remeber how much of the info I thought was in the thread was there, and how much I imagined Smiley. The problem with Thread.dumpStack is that it doesn't dump it to a stream I pass it. This means I can't grab it, and as I have multiple threads, redirecting sys out or sys err just to get the output seems a little on the nasty side Smiley. More importantly, it only dumps the stack of the thread that is executing the call.
Thanks for looking though.

Endolf

Games published by our own members! Go get 'em!
Offline endolf
« League of Dukes »

JGO Kernel
*****

Posts: 1597
Medals: 2


Current project release date: sometime in 3003


« Reply #3 on: 2003-12-12 06:01:33 »

Hi
 I figure a little more background could be usefull on this one Smiley.
 I'm trying to write a junit test for some pooling code I wrote, I need to check that threads are waiting for objects from the pool when they are all out (I configure the pool to 10 objects, and then run 150 threads to try and get them, that should just about make sure there are at least 11 threads running by the time I manage to jump in there Smiley. I have to test the release code, so I can't go dumping debug statements in it (I've already tested that far).

HTH

Endolf

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.086 seconds with 19 queries.