Hi.

If you use thread and while function, just keep a rest in while loop.

HTH.
-Masaaki Onishi-