Space Ghost

Space Ghost

  • NA
  • 45
  • 0

MultiThreading in C#

Feb 23 2010 3:16 PM
Hi all,

I have a method that needs to execute a lot of times. I want to drop my code in there but also the method expects two paramaters for everything to work as expected. No I am faced with the following issue.

I use the System.Threading.ThreadPool class to queue the executions. My current code looks like this:

 foreach (string f in FileList)
  {

  bool u = true;

  ThreadPool.QueueUserWorkItem(new WaitCallback(CreateK2_Excist),  f );


I want to be able to pass in u and f but I can only get the WaitCallback to accept 1 paramater.

How would it be possible to pass in two paramaters too my method??

Thanks in advance!

{SpGh}


Answers (2)