I\'m trying to use threads and prevent the program from freezing while the thread is busy. It should show the progress (writing of 0\'s / 1\'s) and not just show the result
You're defeating the purpose of using threads.
All your thread does is tell the UI thread to execute some code using BeginInvoke().
BeginInvoke()
All of the actual work happens on the UI thread.