Typesafe fire-and-forget asynchronous delegate invocation in C#

后端 未结 7 1795
陌清茗
陌清茗 2020-12-28 19:41

I recently found myself needing a typesafe \"fire-and-forget\" mechanism for running code asynchronously.

Ideally, what I would want to do is somet

相关标签:
7条回答
  • 2020-12-28 20:13

    The compiler-generated BeginInvoke method is also called on the thread pool (reference). So I think ThreadPool.QueueUserWorkItem would be alright, except that you're being a bit more explicit about it I guess (and I suppose a future CLR could choose to run BeginInvoke'ed methods on a different thread pool).

    0 讨论(0)
提交回复
热议问题