Link to home
Start Free TrialLog in
Avatar of JSW21
JSW21Flag for United States of America

asked on

IS ThreadPool.QueueUserWorkItem safe to insert parameters?

client = vary;
data = vary;

ThreadPool.QueueUserWorkItem(
                            delegate
                                {
                                    SendData(Client, data);
                                });

Will my SendData get the correct Client, and data in multi thread application?
My goal is that Client is will be the right guy, during ThreadPool.QueueUserWorkItem called no changing.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Gewgala
Gewgala
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JSW21

ASKER

Hope this is right, since thread 1 will never reuse/switch the client anywhere.
Thread 1 always created anew.