Jump to content
UBot Underground

Recommended Posts

I'm asking about implementation of the Wait Command for Ubot when it comes to multi threading.

 

Wait and Sleep are two different things. I want to understand which one UBot is using before I go out and build some bots I have in mind.

 

A Sleep to me means that when a thread goes to sleep, it gives other threads scheduled in the waiting, a piece of the CPU time slice. Under .NET, Thread.Sleep causes the calling thread to not schedule itself. This is good because we can go out and create threads that do other tasks while Thread A is asleep. For example, if Thread A is responsible for scraping our company website and has to wait 10 seconds, Thread B which is responsible for creating a nice email summary of our website's latest articles, can continue its work without being blocked.

 

A Wait to me is different. When Thread A waits N seconds, all other threads attached to the process wait N seconds and are blocked. Thread A has to be notified from an external object like a Timer to run again. There are no performance benefits from a Wait as the threads are doing no work.

 

Eddie, can you fill me in on this? What does Wait do under the hood?

Link to post
Share on other sites

wait in a thread is indepent from other threads like everything u do in a thread

thread in ubot means complete uncoupled process from the rest. is like another instance of a program

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...
×
×
  • Create New...