ruben.rodrigues
7th June 2011, 15:17
Hi all!
I wrote a program that uses multiple threads and I am having some pauses in the middle of one of them that I can't understand.
One of the threads reads digital inputs from a machine to see if buttons are pressed and the other thread has a class that writes/reads tcp packages from a server that controls a laser.
These 2 threads are created by the same class but don't share anything. What happens is that when I call the line "tcpsocket->waitForReadyRead()" the thread that checks for the digital inputs just pauses and when the command is finished runs again.
Other than this problem the program runs perfectly but I realy need to read digital inputs while the program is waiting for an answer from the server.
Any tips?
Thanks!
I wrote a program that uses multiple threads and I am having some pauses in the middle of one of them that I can't understand.
One of the threads reads digital inputs from a machine to see if buttons are pressed and the other thread has a class that writes/reads tcp packages from a server that controls a laser.
These 2 threads are created by the same class but don't share anything. What happens is that when I call the line "tcpsocket->waitForReadyRead()" the thread that checks for the digital inputs just pauses and when the command is finished runs again.
Other than this problem the program runs perfectly but I realy need to read digital inputs while the program is waiting for an answer from the server.
Any tips?
Thanks!