May 2010
Intermediate to advanced
1272 pages
61h 18m
English
In many cases you might have the need to pass data to new threads. This can be accomplished by creating an instance of the ParameterizedThreadStart delegate, which requires an argument of type Object that you can use for sharing your data. The following code demonstrates how you create a thread with parameters:

Notice how the Thread.Start method has an overload that takes the specified parameter as the data. Because such data is of type Object, you need to convert it into the most appropriate format. The following code demonstrates how to implement a method that the delegate refers to and how to convert the data into a hypothetical ...
Read now
Unlock full access