grinder java test code
Gang Yan <[email protected]> Wed, 18 Mar 2015 00:52:33 -0700 (PDT)
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <452e3497-03f5-49d2-9e29-ad3297cd5f5b@default> |
Hi all
I test jvm threads stack test . I use follow java test code: I want to use grinder execute JVM threads test. How to call java test code in Grinder?
Java test code:
public class TestThreadStackOverFlow {
private static void genThreads(){
int count = 0;
while (true) {
Thread thread = new Thread(new Runnable() {
public void run() {
try{
Thread.sleep(20 * 60 * 1000);
}catch(Exception e){
}
}
});
thread.start();
System.out.println("~~~~ Thread's name is : ["+ thread.getName() +
"] Total threads count is : ["+ ++count +"]");
try{
Thread.currentThread().sleep(50);
}catch(Exception e){
e.printStackTrace();
}
}
}
public static void main(String[] args) {
genThreads();
}
}
Test result:
~~~~ Thread's name is : [Thread-33] Total threads count is : [34]
~~~~ Thread's name is : [Thread-34] Total threads count is : [35]
~~~~ Thread's name is : [Thread-35] Total threads count is : [36]
~~~~ Thread's name is : [Thread-36] Total threads count is : [37]
--
HYPERLINK "http://www.oracle.com/" \nOracle
Yan Gang
ORACLE China
HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle
Oracle is committed to developing practices and products that help protect the environment
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use