Hi I am developping an application using several threads. I think I have an important synchronization problem.

A simple example using j2me: in "startApp" I have 2 objects: the object A where there is a thread and inside the "run" there is a "while". On the other hand, in the other object B, there is a "timertask" and consecuently the "run" will be activated evry a specific time.
If the program is working using only one of these objects (any of them) then the program is working correctly. But if both objects are working together the object B (of the timertask) works first and foremost. Some seconds later the "while" of the object A works madly without stopping... I would like that both could work side by side...

Does anyone know the problem? does anyone know the way to synchoronize both objects?
Thanks for your help :)