Jump to content
Sign in to follow this  
vijay1440

About Threads

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();	}}

Share this post


Link to post
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();	}}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...