Parameterized Methods
Learn how to pass data to threads using the ParameterizedThreadStart delegate and handle type safety limitations in C#.
We'll cover the following...
We'll cover the following...
Running a parameterless method on a thread is achieved by passing an instance of the ThreadStart delegate to a Thread constructor. However, we often need to pass some parameters to the thread for it to process. The ParameterizedThreadStart delegate is used for this purpose.
The ParameterizedThreadStart delegate
Running a parameterless method on a thread is achieved by passing an instance of the ThreadStart delegate to a Thread constructor. However, threads often require input data. The ParameterizedThreadStart delegate is designed for this purpose: