This is simple multithreading application that sort integers values in an array.
I have used VS.NET to implement this program. Double click on Sort.Zip and extract all the files and folders in to a folder in C drive.
Run the project using VS.NET:
Double click on Sort.sln (Prject file). Then run the project (press F5). The Form1 will appear as shown below.
Run using command-line prompt.
Copy all the .cs files (From1.cs) in to a folder in C drive and compile it using
C:\FolderName> csc *.cs
This will create a Form1.exe file inside the folder. Then double click it run it.

Martin MulderPosted Jul 17, 2011, 9:30 AM
When you start running your application, I get an cross-thread-exception. Since this is an article about multithreading (and sorting) I do not expect that the programmer would make a mistake like this. Second... the sorting routine is executed x times, where x is the number of threads. The actual work is not divided into parts, instead, every thread is doing exactly the same job. Locking is used to make sure only one thread is doing a sorting-action. So in fact nothing is done parallel cause they are all waiting for one thread to do a tiny piece of work. Last: Why is every thread stopping itself with Abort()?