In real time Java one can create a real time thread and run it via the following methods:
RealtimeThread rt = new RealtimeThread(){
public void run(){
/*do work*/
}
};
rt.start();
RealtimeThread rt2 = new RealtimeThread();
rt2.start();
RealtimeThread rt3 = new RTThread();
rt3.start();
where RTThread is a class which extends RealtimeThread. But clearly the above approaches does not work when it comes to main. So is there a way to do it? My motivation for this is that I want only 2 real time threads to run. If I start two real time threads within main, won't there be a total of 3 threads?
if the
RealtimeThread
s are not deamon threads you can let the main thread finish and keep everything running inside theRealtimeThread
s