Jump to content

About Threads


vijay1440

Recommended Posts

Conceptually, one suggestion would be that you make the thread check for some state (i.e. the object is loaded), if it isn't there, sleep for a bit. When it stops sleeping, check for the state. If it isn't there, sleep for a bit.pseudo-code:

private void WaitForState(){	if(object is null)	{		sleep();		WaitForState();	}}

Link to comment
Share on other sites

Thank you very much for the suggestion. I guess this may work. And I have something else in mind. Shall we have some method on object like wait, which we can invoke to wait till it is not used by anyone?

Conceptually, one suggestion would be that you make the thread check for some state (i.e. the object is loaded), if it isn't there, sleep for a bit. When it stops sleeping, check for the state. If it isn't there, sleep for a bit.pseudo-code:
private void WaitForState(){	if(object is null)	{		sleep();		WaitForState();	}}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...