O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an application with threads

As we have tested the decryption of the previously encrypted message, we are sure it is working fine. We are now going to run the encryption algorithm in a new thread created using the Thread class.

We want to use the Thread class to have tight control over the execution of the different processing threads in our application. First, we need to make the encryption function run in just one thread. Later, we will align the threads with the number of cores in our hardware to ensure maximum efficiency. So, for now, we will change the application we previously built so that the encryption logic runs in a separate thread from the main application. This will begin to give us control over when and how we encrypt the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required