C# Communication between threads

后端 未结 6 528
情话喂你
情话喂你 2021-01-11 22:34

I am using .NET 3.5 and am trying to wrap my head around a problem (not being a supreme threading expert bear with me).

I have a windows service which has a very int

6条回答
  •  轮回少年
    2021-01-11 23:32

    Call the method using ThreadPool.QueueUserWorkItem instead. This method grabs a thread from the thread pool and kicks off a method. It appears to be ideal for the task of starting a method on another thread.

    Also, when you say "typical ThreadStart" do you mean you're creating and starting a new Thread with a ThreadStart parameter, or you're creating a ThreadStart and calling Invoke on it?

提交回复
热议问题