Sunday, June 13, 2004 09:08 AM
You should use wait() notify(), not sleep(). This way the thread is only active when you have work for it.
You should set the priority setPriority() of the thread to a proper (whatever that means) value so that other threads get cpu time.
You should use yield() in place of the sleep(5) to give other threads cpu time.
Naturally there are other methods depending on your specific needs.