有没有办法从 .NET 3.5 中的 System.Collections.Concurrent 获取类?
这个问题几乎说明了一切。
有谁知道有什么方法可以从 .NET 3.5 中的 System.Collections.Concurrent 命名空间获取集合类吗?
我想我要问的是是否有人经历过将这些类移植到可以从 .NET 3.5 访问的自己的 DLL 中的麻烦。
The question pretty much says it all.
Does anyone know of any way to get the collection classes from the System.Collections.Concurrent
namespace in .NET 3.5?
I guess what I'm asking is whether anyone has gone through the trouble of porting these classes to their own DLL that could be accessed from .NET 3.5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
更新:遗憾的是,反应式扩展库似乎不再为 .NET 3.5 提供。但是,如果您能找到该库的旧版本,它肯定包含 .NET 3.5 并发集合类的向后移植。我知道,因为我在以前的公司广泛使用过它们。
我只是偶然发现了这一点。
事实证明,这些集合一直可以通过 Microsoft 的反应式扩展 (Rx) 库< /a>,可用于 .NET 3.5,事实上我已经使用有一段时间了(只是从未意识到它们在那里)。
System.Collections.Concurrent
命名空间由 System.Threading.dll 提供。只是将其发布在这里供后代使用。
Update: The reactive extensions library doesn't appear to be offered for .NET 3.5 anymore, sadly. However, if you can find an older version of the library, it definitely did contain backports of the concurrent collection classes for .NET 3.5. I know because I used them extensively at a previous company.
I just discovered this by accident.
It turns out these collections were available all along through Microsoft's Reactive Extensions (Rx) library, which is available for .NET 3.5, and which in fact I have been using already for some time (just never realized they were there).
The
System.Collections.Concurrent
namespace is provided by System.Threading.dll.Just posting this here for posterity.
不,它们位于
System.dll
4.0 版本中。因此,尝试将其引入 3.5 应用程序是行不通的。No, they are in the 4.0 version of
System.dll
. So trying to pull that in to a 3.5 app would not work.我使用了.NET 3.5 的任务并行库。效果很好。
该包包括:
用于执行异步操作的任务。
并发集合,例如 ConcurrentStack、ConcurentQueue 和 ConcurrentDictionary。
用于编写并行查询的 PLINQ。
其他线程操作,例如 Barrier、SpinLock 和 SpinWait。
I used the Task Parallel Library for .NET 3.5. Works great.
The package includes:
Task for executing asynchronous operations.
Concurrent Collections such as ConcurrentStack, ConcurentQueue ad ConcurrentDictionary.
PLINQ for writing parallel queries.
additional Threading operations such as Barrier,SpinLock and SpinWait.