开发者

How to tell thread-pool to run a delegate on a `STA` thread?

开发者 https://www.devze.com 2023-02-01 17:09 出处:网络
I need a thread-pool for working with COM objects inside an ASP.NET project. QueueUse开发者_StackOverflowrWorkItemSTA(WaitCallback)

I need a thread-pool for working with COM objects inside an ASP.NET project.

QueueUse开发者_StackOverflowrWorkItemSTA(WaitCallback)


From the CodeProject Article of Smart Thread Pool:

Also note that the .NET ThreadPool doesn't support calls to COM with single threaded apartment (STA), since the ThreadPool threads are MTA by design.

So I assume if you give the Smart Thread Pool a try, it could fit your requirements.

Personally, I use this class successfully since severals years.

0

精彩评论

暂无评论...
验证码 换一张
取 消