Wjybxx.Commons.Concurrent 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package Wjybxx.Commons.Concurrent --version 1.0.8                
NuGet\Install-Package Wjybxx.Commons.Concurrent -Version 1.0.8                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wjybxx.Commons.Concurrent" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Wjybxx.Commons.Concurrent --version 1.0.8                
#r "nuget: Wjybxx.Commons.Concurrent, 1.0.8"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Wjybxx.Commons.Concurrent as a Cake Addin
#addin nuget:?package=Wjybxx.Commons.Concurrent&version=1.0.8

// Install Wjybxx.Commons.Concurrent as a Cake Tool
#tool nuget:?package=Wjybxx.Commons.Concurrent&version=1.0.8                

csharp-commons

csharp公共库,包含集合等基础组件;nuget搜索'wjybxx'即可查看到相关库。

注意: 1.0.x 尚属于快速迭代版本,等基础工具基本完备的时候,会更新到 1.1.x 版本。因为我还有几个项目没有完成,会把遇见的一些基础工具迁移到这里,或在这里实现。

ReleaseNotes

1.0.7

  1. bugfix - LinkedDictionary/LinkedHashSet移动元素到首尾时未更新version
  2. DateTime工具类

1.0.6

  1. 增加ArrayPool,变更ObjectPool的Clear方法为FreeAll
  2. 增加环境变量工具类
  3. 增加BufferUtil

1.0.5

  1. 添加StringBuilderPool,为Dson仓库服务
  2. ObjectPool接口删除不必要方法

1.0.4

  1. 迁移仓库,和Java Commons仓库合并。
  2. Build更改为Release

1.0.3

  1. 移植Time工具包
  2. 增加部分常用异常
  3. 增加轻量级对象池

1.0.2

  1. Collection增加IsEmpty方法
  2. 增加少量DateTime工具方法

1.0.1

  1. BoundedArrayDeque fix Count为0时SetCapacity导致的head下标错误。

Collections

但凡C#的基础集合库好用一点,我也不至于自己造轮子,实现的集合类:

  1. LinkedDictionary 保持插入顺序的字典,并提供大量的有用方法。
  2. LinkedHashSet 保持插入顺序的Set,并提供大量的有用方法。
  3. IndexedPriorityQueue 含索引的优先级队列,高查询和删除效率。
  4. BoundedArrayDeque 基于数组的有界双端队列,允许手动调整容量。
  5. MultiChunkDeque 分块无界双端队列。

LinkedDictionary特殊接口示例:


    public class LinkedDictionary<TKey,TValue> {
        TKey PeekFirstKey();
        TKey PeekLastKey();
        void AddFirst(TKey key, TValue value);
        void AddLast(TKey key, TValue value);
        KeyValuePair<TKey, TValue> RemoveFirst();
        KeyValuePair<TKey, TValue> RemoveLast();
        TValue GetAndMoveToFirst(TKey key);        
        TValue GetAndMoveToLast(TKey key);
    }
    

LinkedDictionary采用线性探测法解决hash冲突,通过在GetNode方法中记录线性探测次数,统计查询数据如下:

  1. 1W个int类型key,查询所有key,线性探测总次数 4000~5000, 平均值小于1
  2. 10W个int类型key,查询所有key,线性探测总次数 11000~12000,平均值小于1
  3. 1W个string类型key,长度24,查询所有key,线性探测总次数 4000~5000,平均值小于1 -- 与int相似,且调整长度几无变化。
  4. 10W个string类型key,长度24,查询所有key,线性探测总次数 11000~12000,平均值小于1 -- 与int相似,且调整长度几无变化。
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.0 104 9/7/2024
1.1.2 129 8/25/2024 1.1.2 is deprecated because it has critical bugs.
1.1.1 142 8/23/2024 1.1.1 is deprecated because it has critical bugs.
1.1.0 139 8/21/2024 1.1.0 is deprecated because it has critical bugs.
1.1.0-rc3 49 7/31/2024
1.1.0-rc1 70 7/14/2024
1.0.15 112 6/29/2024
1.0.12 126 4/11/2024
1.0.11 119 4/9/2024
1.0.10 123 4/8/2024
1.0.9 121 4/3/2024
1.0.8 123 3/18/2024