06-23-2014 12:41 PM
In my applications i have multiple threads which trys to polls continously from server for certain time interval to retrive information. while debuging the device gets freezed sometimnes so i need to restart the application by disconnection device and connecting again. is there any better way to debug multiple threads without getting device freezed.
Model : 8520
OS : 5.0
06-23-2014 08:47 PM - edited 06-23-2014 08:50 PM
Let me start by suggesting, as I am sure that anyone you have talked to has, that you don't poll. Use push to send data to the device when it is updated, don't poll to find out that it hasn't been. Polling wastes battery and potentially uses up a load of data.
But looking at your problem, in general, reading data from the Server does not cause the device to freeze. However the connection can 'freeze' and then take two minutes to timeout, so perhaps this is your problem.
Alternatively, you might have some interaction between your Threads that causes a problem.
Or you might have exception being thrown that you don't know about, and this causes your procesing to fail. Check the device log (ALT LGLG) or debug log to see these. However if you are debugging at the time, as the question suggests, then you will get presented with this exception, so I am not sure that this is your problem.
The best thing to do is to add some logging in your application to make sure you know exactly what all your Threads are doing at any time and can therefore track the circumstances that causes this freeze.
Beyond that, I am not sure we can help much with the information provided.