running background thread continiously...

hello...i want to run 2-3 threads parralaly and continiously until application shut down..can u suggest me any java apis provide that much of parralalism...actually the threads are running to receive notification of different events...
[249 byte] By [samriddha] at [2007-11-26 19:37:17]
# 1
> any java apis provide that much of parralalism..? I don't know what you mean. Could you explain what you are trying to do, what your goal is.Have you studied the tutorial on concurrency: http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html
DrLaszloJamfa at 2007-7-9 22:14:11 > top of Java-index,Java Essentials,Java Programming...
# 2

ok..my aim is to run 2 threads concurrently...let s have a lokk at the following code....

import java.io.*;

import java.util.*;

class testtimer extends TimerTask

{

public void run()

{

System.out.println("timer started");

}

}

class testtimer2 extends TimerTask

{

public void run()

{

System.out.println("timer 2 started");

}

}

class maintimer

{

public static void main(String args[])

{

testtimer t1=new testtimer();

testtimer2 t2=new testtimer2();

Timer tm=new Timer(true);

tm.schedule(t1,1000,1000);

tm.schedule(t2,1500,500);

try

{

Thread.sleep(10000);

}

catch(Exception e)

{

System.out.println("Exception occurred");

}

}

}

now suppose i want to run this program till to computer shutdown....

and i also want to fix the execution time of both the timertask thread..

samriddha at 2007-7-9 22:14:11 > top of Java-index,Java Essentials,Java Programming...