Hey there,

I've got a query when it comes to threads since im quite new.

class A
//default constructor....
//Contructs Class B which implements the Runnable interface.

Class B

//does some stuff.

my question is theres 2 threads here, but what if i want Class B to wait for an event to happen from Class A in order to carry on processing? I'm not sure how to do this... Anyone wanna shine some light into it?

Well, if the Runnable has a method which Class A can call when appropriate, it can simply sleep while monitoring for whatever state Class A is expected to set.

For some general info, this article on thread messaging may be useful:
http://www.informit.com/articles/article.aspx?p=167821&rll=1

Be a part of the DaniWeb community

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