简体   繁体   中英

.NET/C# - What is the best option instead of an ActionBlock<T> (or Channel<T>) for speed?

corefxlab has something called a Channel which is a really nice implementation of an async PC queue and definitely does what I'm looking for. I'm curious if there's an implementation that ultimately had a similar API to ActionBlock<T> :

  1. Must be able to accept/deny from multiple producers.
  2. Only needs to have one consuming task but would be preferable that it continue processing until empty. Then 'wait' for new items.

A Channel<T> is much faster than an BufferBlock<T> but I'm just curious if given the specific requirements if there was something even faster.

According to a readme by Stephen Toub, Channels might end up being the underlying implementation around some Dataflow blocks. Channels wins for PC queue async speed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM