for program to be concurrent i created 4 threads as below

 Thread th1 = new Thread(a1.run);
            Thread th2 = new Thread(b1.run);
            Thread th3 = new Thread(c1.run);
            Thread th4 = new Thread(d1.run );  


how do i know when the threads are finised done with the work, i print the th4 output to the consol panel and i know it is done with its work) but the program does not end

how do i end the threads?

appreciate a reply

Recommended Answers

All 4 Replies

You end a Thread by returning from the method specified in the Thread constructor.

i got it

i had to terminate the while look in the threads i created

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.