ubotusold 28 Posted July 21, 2012 Report Share Posted July 21, 2012 Does the Wait command Sleep in a multi-threaded bot? Quote Link to post Share on other sites
Praney Behl 314 Posted July 22, 2012 Report Share Posted July 22, 2012 Not sure what you exactly want to ask, but theoretically Yes. Quote Link to post Share on other sites
ubotusold 28 Posted July 22, 2012 Author Report Share Posted July 22, 2012 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? Quote Link to post Share on other sites
blumi40 222 Posted July 22, 2012 Report Share Posted July 22, 2012 wait in a thread is indepent from other threads like everything u do in a threadthread in ubot means complete uncoupled process from the rest. is like another instance of a program Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.