Several threads. Need Sleep?
in
Programming Questions
•
2 years ago
I have several threads... main thread, keyboard tracker thread, java nio connection manager and a number of some worker threads... my question is - do I need inserting a 'Sleep' command in each of them? I have heard that if a thread never sleeps, it loads the CPU up to the cap.. is it true? Do I need to put 'Sleep' in each of them? If so, then, in case with the Keyboard-Tracking thread, will it result in delayed key-watching (this is what concerns me the most)?
Any better idea on keywatcher thread?
1