Re: [Dev-C++] how to update data constantly?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Chris M. <lor...@gm...> - 2007-12-06 22:49:36
|
On Dec 6, 2007 2:41 AM, Per Westermark <pw...@ia...> wrote: > One alternative is to let the RS232 thread send messages to the GUI > thread. Either with the serial data, or just as information that there are > serial data available. > > /pwm I would like to note that this does have a significant drawback. If you have to update the GUI every time something happens, it has a tendency to lag in a big way. You can alleviate this by only updating every X updates, however, this adds a problem of constantly checking whether or not the update threshold has been reached. It's far simpler to use the mutex approach, even though it is slightly more difficult to implement and harder to understand (if you're not familiar with it). Once I tried having the working thread update the GUI in Java.... locked up the whole GUI during operation, so if you wanted to kill it you'd have to kill the running JVM - not fun! -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman John 3:16! If Microsoft is the Wal*Mart of the Software World, then Linux is the Home Depot |