Click here to Skip to main content
15,899,679 members
Home / Discussions / Java
   

Java

 
AnswerRe: static keyword problem..... Pin
Ashish Tyagi 4013-Jul-11 6:25
Ashish Tyagi 4013-Jul-11 6:25 
QuestionProblem in Multithreading ,,.... Pin
gateway237-Jul-11 17:47
gateway237-Jul-11 17:47 
AnswerRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 19:34
TorstenH.7-Jul-11 19:34 
GeneralRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:30
David Skelly7-Jul-11 22:30 
GeneralRe: Problem in Multithreading ,,.... Pin
TorstenH.7-Jul-11 22:42
TorstenH.7-Jul-11 22:42 
AnswerRe: Problem in Multithreading ,,.... Pin
David Skelly7-Jul-11 22:28
David Skelly7-Jul-11 22:28 
GeneralRe: Problem in Multithreading ,,.... Pin
gateway237-Jul-11 23:07
gateway237-Jul-11 23:07 
AnswerRe: Problem in Multithreading ,,.... Pin
Ashish Tyagi 4013-Jul-11 7:04
Ashish Tyagi 4013-Jul-11 7:04 
To ensure that a thread (referenced by some reference say threadRef) is finished, then you join() on that reference. like threadRef.join() if that thread is finished, then join() returned immediately otherwise join() will blocked until that thread get finished.

For example if you create three thread (a, b, c) for doing three different task A, B, C, from your main thread, but you need some initialization processing (which must be executed before start-up of a, b, c) and shutdown processing (which must be executed after finishing of a, b, c) then you may code like this




// in main()

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

initialization(); // a, b, c are not running yet.

System.out.println("initialization complete ");

Thread a = new Thread(new Task_A_RunnableClass());
Thread b = new Thread(new Task_B_RunnableClass());
Thread c = new Thread(new Task_C_RunnableClass());


a.start();
System.out.println("Thread "a" started ");

b.start();
System.out.println("Thread "b" started ");

c.start();
System.out.println("Thread "c" started ");

//Now wait for all thread to finished.

a.join();
System.out.println("Thread "a" finiished ");

b.join();
System.out.println("Thread "b" finiished ");

c.join();
System.out.println("Thread "c" finiished ");

shutdown(); // a, b, c are finished now.

System.out.println("System shutdown..... ");
QuestionLoadin page while transferring control from one jsp to another jsp Pin
yog.khopade6-Jul-11 23:31
yog.khopade6-Jul-11 23:31 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
TorstenH.7-Jul-11 19:33
TorstenH.7-Jul-11 19:33 
AnswerRe: Loadin page while transferring control from one jsp to another jsp Pin
Richard MacCutchan7-Jul-11 23:08
mveRichard MacCutchan7-Jul-11 23:08 
QuestionUnchecked casting? Pin
Neo101016-Jul-11 22:03
Neo101016-Jul-11 22:03 
AnswerRe: Unchecked casting? Pin
David Skelly6-Jul-11 22:30
David Skelly6-Jul-11 22:30 
QuestionNEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. [modified] Pin
Member 80110535-Jul-11 23:16
Member 80110535-Jul-11 23:16 
AnswerRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Richard MacCutchan6-Jul-11 0:39
mveRichard MacCutchan6-Jul-11 0:39 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Member 80110536-Jul-11 2:57
Member 80110536-Jul-11 2:57 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Richard MacCutchan6-Jul-11 3:26
mveRichard MacCutchan6-Jul-11 3:26 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Member 80110536-Jul-11 3:31
Member 80110536-Jul-11 3:31 
AnswerRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
TorstenH.6-Jul-11 0:50
TorstenH.6-Jul-11 0:50 
GeneralRe: NEED HELP REGARDING EMBEDDING THE CHAT SERVER I MADE ON MY WEBSITE TO SERVE AS LIVE CHAT. Pin
Member 80110536-Jul-11 2:58
Member 80110536-Jul-11 2:58 
Questiontry block problem in java.. Pin
gateway235-Jul-11 20:58
gateway235-Jul-11 20:58 
AnswerRe: try block problem in java.. Pin
Cedric Moonen5-Jul-11 21:39
Cedric Moonen5-Jul-11 21:39 
GeneralRe: try block problem in java.. Pin
gateway235-Jul-11 22:12
gateway235-Jul-11 22:12 
GeneralRe: try block problem in java.. Pin
Cedric Moonen5-Jul-11 22:35
Cedric Moonen5-Jul-11 22:35 
GeneralRe: try block problem in java.. Pin
David Skelly6-Jul-11 3:47
David Skelly6-Jul-11 3:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.