Real time drawing using multithreading
-
Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.
-
Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.
-
Hello there, I am looking for the best Way/Strategy to "Continuously read data from the HW in real-time and draw some GUI-diagram in Parallel". Performance would be a big matter here since the graph has to be drawn in real-time. Its just coming to my mind about 1) creating 1 worker-thread for reading process, and 2) another for GUI drawing. But I am looking for perfection and suggestions here. 1) Is there any specific Design-Pattern that would fit this?. If so, please suggest. 2) Whats the best way(container) to read data by the worker-thread and keep it for the GUI-thread to process. FIFO? or some other class? Thanks in advance for your suggestion and advice.
For worker threads, read here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
FrankStar89 wrote:
Performance would be a big matter here since the graph has to be drawn in real-time.
How many points per second? Presumably there is no data munging at all?
Thanks Jschell. I am not sure yet how many points per sec. ( still in the initial stage.) I think there would be data munging for sure. Anyway, what I was looking here mostly any "usual Design Pattern" for this kind of problem in general. (1 thread is reading and another is drawing simultaneously). Thanks again.
-
For worker threads, read here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Thanks David, That would surely be helpful.
-
Thanks Jschell. I am not sure yet how many points per sec. ( still in the initial stage.) I think there would be data munging for sure. Anyway, what I was looking here mostly any "usual Design Pattern" for this kind of problem in general. (1 thread is reading and another is drawing simultaneously). Thanks again.