Hi
Thank you for reading my post.
I have a problem with threads and timers ,
my problem is :
I send some data over a port to some device , now i should wait until the device send me an acknoledge
after device send the ack i will go with sendingnext data.
Now , after i send first data , i execute a thread
inside that thread , i have a while loop
inside the loop i read the port until the ACK port values go to true,
then i exit the loop and exit the thread too.
this solution works , but it has some other problems
1-in this case java process will eat all CPU cycles
2-my application will GUI does not response good enought
How i can solve this problem ?
Thanks
here is the code that i create the thread and execute it
Thank you for reading my post.
I have a problem with threads and timers ,
my problem is :
I send some data over a port to some device , now i should wait until the device send me an acknoledge
after device send the ack i will go with sendingnext data.
Now , after i send first data , i execute a thread
inside that thread , i have a while loop
inside the loop i read the port until the ACK port values go to true,
then i exit the loop and exit the thread too.
this solution works , but it has some other problems
1-in this case java process will eat all CPU cycles
2-my application will GUI does not response good enought
How i can solve this problem ?
Thanks
here is the code that i create the thread and execute it