Hi,
I have a question about the threadpool. ThreadPool accepts to pass along an object as shown in my code.
I will pass along 3 doubles, which I ofcourse could make to a string object, - and then convert it back to doubles in the "receiveDoubles" function. This is no problem to do.
However, I wonder if it is possible to pass along the doubles as type "double" and receive those 3 doubles as type "double" in the "receiveDoubles" function, which mean that no conversion will be needed anywhere?
(Reason is otherwise a huge amount of conversions)
public void receiveDoubles(object getdoubles)
{
//Is it possible to receive doubles without converting here, which takes time?
double one = 0;
double two = 0;
double three = 0;
}
private void button1_Click(object sender, EventArgs e)
{
object senddoubles = new object();
//Send along those doubles
double one = 21.51;
double two = 21.52;
double three = 21.53;
ThreadPool.QueueUserWorkItem(new WaitCallback(receiveDoubles), senddoubles);
}