How you create multiple threads depends on the operating system and language you are using. Microsoft’s Task Parallel Library (TPL) is a specific library of tools that makes running parallel threads relatively easy for Microsoft .NET applications.
The following list summarizes the main tools provided by the TPL:
Parallel.Invoke Executes several pieces of code at the same time.
Parallel.For Executes the same pieces of code several times in parallel, with different numbers as parameters. For example, it might invoke some code to produce frames in an animated movie where the parameters 1, 2, 3, and so on are passed to the code so it knows which frame number to generate.
Parallel.ForEach Executes the same pieces of code several times ...