I am planning to implementing a multiuser system.
Can I use sleep inside threads. Just want to know will it cause any issues while running multiple threads.
I am planning to implementing a multiuser system.
Can I use sleep inside threads. Just want to know will it cause any issues while running multiple threads.
I am planning to implementing a multiuser system.
Good
Can I use sleep inside threads.
Yes
Just want to know it will cause any blocking issues while running multiple threads.
No
However - it is advisable to avoid sleeping in threads unless you really have no choice. You should use inter-thread communications techniques such as BlockingQueue
s instead if you can.
Some kind of PauseableThread may be a better option.