I have a .net2/c# application. It receives data from a socket, formats and displays in a richtextbox control. The communication happens in a seperate thread. The received data is added to a queue that the display function extracts. Quite some heavy duty formatting is done- sorting, coloring etc. The Display function is in the main thread. What I have observed is when there is lot of data to display the whole computer freezes. The toolbar button to abort the display or for that matter the ALT-TAB to switch to another app doesnt work either. I managed to open the task manager on the top of the app and the cpu consumption is only about 25% ( the task manager itself appears to run slow). Any ideas on what might be causing this ? Thanks in advance.
+1
A:
The display function that formats the data I suppose it dequeues the data. Is this done on a separate thread? You might consider to do that, if you did not do it already At what point to you actually set the text in the richtextbox? Have in mind that in a multithread environement, any operations that operate on the UI need to be done on the UI thread (InvokeRequired)
anchandra
2010-05-06 21:29:25