Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi to all.

in my program with C#, i produce much data. The production of data takes much time like 5 minute. i want to show produced data in time on form while data has been produced.

my program show all data after that all data produced.!!!

can i do this work by multithreading and how?

thanks.
Posted
Updated 15-Sep-14 11:22am
v4
Comments
George Jonsson 15-Sep-14 21:35pm    
You can probably use multithreading to solve your problem.
The thing is that you don't provide enough information in order to give a proper answer.
Do your GUI to update the date while it is produced?
Try to elaborate on your problem.

1 solution

This topic requires more detailed consideration. Different techniques can be used for synchronizing of data. The applicability of those techniques depends on many factors. One thing you should know is the UI thread invocation mechanism. Please see my past answers:
Problem with Treeview Scanner And MD5[^],
Control.Invoke() vs. Control.BeginInvoke()[^].

You should also understand threading and thread synchronization in general. One specific thing you need to understand is the producer-consumer problem. Please see: http://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem[^].

See also my article: Simple Blocking Queue for Thread Communication and Inter-thread Invocation[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900