惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
Arctic Wolf
博客园 - 聂微东
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
L
LangChain Blog
A
About on SuperTechFans
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
T
The Blog of Author Tim Ferriss
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Palo Alto Networks Blog
Scott Helme
Scott Helme
S
Secure Thoughts
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
P
Privacy & Cybersecurity Law Blog
O
OpenAI News
H
Heimdal Security Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Help Net Security
Help Net Security
C
Cyber Attacks, Cyber Crime and Cyber Security
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
G
Google Developers Blog
博客园 - Franky
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
Kaspersky official blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Tor Project blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tenable Blog
Google Online Security Blog
Google Online Security Blog
PCI Perspectives
PCI Perspectives

博客园 - ®Geovin Du Dream Park™

go: Functional Options Pattern go:Timing Functions Pattern python: Timing Functions Pattern go: Steady-State Pattern python: Steady-State Pattern go: Handshaking Pattern python: Handshaking Pattern go: Fail-Fast Pattern python: Fail-Fast Pattern I go: Deadline Pattern python: Deadline Pattern go: Circuit-Breaker Pattern python: Circuit-Breaker Pattern go: Bulkheads Pattern python: Bulkheads Pattern go: Push & Pull Pattern python: Push & Pull Pattern python: Publish/Subscribe Pattern II go: Publish/Subscribe Pattern python: Publish/Subscribe Pattern go: Futures & Promises Pattern python: Futures & Promises Pattern go: Worker Pool Pattern go:Pipeline Pattern python: Worker Pool Pattern python: Pipeline Pattern go: Fan-Out Pattern python: Fan-Out Pattern go: Fan-In Pattern python: Fan-In Pattern Fan-In go: Producer Consumer  Pattern python: Producer Consumer Pattern go: Parallelism Pattern python: Parallelism Pattern go: Reactor Pattern python: Reactor Pattern go: Generators Pattern python: speech to text offline python: Generators Pattern go: Coroutines Pattern python:Coroutines Pattern go: Broadcast Pattern python: Broadcast Pattern python: Bounded Parallelism Pattern go: Bounded Parallelism Pattern python: N-Barrier Pattern go: N-Barrier Pattern python: Semaphore Pattern go: Semaphore Pattern python: Read-Write Lock Pattern go: Read-Write Lock Pattern python: Monitor Pattern go: Monitor Pattern python: Mutex Pattern go: Lock/Mutex Pattern Python: Condition Variable Pattern go:Condition Variable Pattern python: Registry Pattern python: Interpreter Pattern go: Interpreter Pattern go: Registry Pattern go: Memento Pattern go: Command Pattern go: State Pattern go:Template Method Pattern go: Strategy Pattern go: Visitor Pattern go: Observer Pattern go: Mediator Pattern go: Iterator Pattern go: Chain of Responsibility Pattern go: Proxy Pattern go:Decorator Pattern go: Facade Pattern go: Flyweight Pattern go: Composite Pattern go: Singleton Pattern go: Prototype Pattern go: Bridge Pattern go: Adapter Pattern go: Builder Pattern 密码进行加盐哈希 using CSharp,Python,Go,Java go: Abstract Factory Pattern go: Model,Interface,DAL ,Factory,BLL using mysql go: Simple Factory Pattern go: Factory Method Pattern go: goLang 在Windows环境搭建Go语言开发环境 cpp: class python: 蝴蝶跟随鼠标 javascript: 中国历史人物热力分布图using echart javascript: 中国历史人物热力图 python: 初养龙虾微信纯文字自动回复using workBuddy python: object 入门 python: Factory Method Pattern python: Simple Factory Pattern python: Abstract Factory Pattern 区域化 代码 python: Null Object Pattern python: Builder Pattern python: Adapter Pattern
CSharp: Parallel Extensions
®Geovin Du Dream Park™ · 2026-03-29 · via 博客园 - ®Geovin Du Dream Park™
  /// <summary>
    /// Parallel Extensions
    /// </summary>
    class Program
    {
        // 数量配置
        private const int NUM_AES_KEYS = 800000;
        private const int NUM_MD5_HASHES = 100000;

        /// <summary>
        /// 字节数组转16进制字符串
        /// </summary>
        private static string ConvertToHexString(Byte[] byteArray)
        {
            var sb = new StringBuilder(byteArray.Length);
            for (int i = 0; i < byteArray.Length; i++)
            {
                sb.Append(byteArray[i].ToString("X2"));
            }
            return sb.ToString();
        }

        /// <summary>
        /// 生成 AES 密钥(.NET 4.0 必须用 AesManaged)
        /// </summary>
        private static void GenerateAESKeys()
        {
            var sw = Stopwatch.StartNew();

            // .NET 4.0 写法
            using (var aesM = new AesManaged())
            {
                for (int i = 1; i <= NUM_AES_KEYS; i++)
                {
                    aesM.GenerateKey();
                    byte[] result = aesM.Key;
                    string hexString = ConvertToHexString(result);
                }
            }

            // 直接输出到控制台,看得见!
            Console.WriteLine("AES 任务耗时:" + sw.Elapsed);
        }

        /// <summary>
        /// 生成 MD5 哈希
        /// </summary>
        private static void GenerateMD5Hashes()
        {
            var sw = Stopwatch.StartNew();

            using (var md5M = MD5.Create())
            {
                for (int i = 1; i <= NUM_MD5_HASHES; i++)
                {
                    byte[] data = Encoding.Unicode.GetBytes(Environment.UserName + i.ToString());
                    byte[] result = md5M.ComputeHash(data);
                    string hexString = ConvertToHexString(result);
                }
            }

            Console.WriteLine("MD5 任务耗时:" + sw.Elapsed);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("===== .NET 4.0 并行执行演示 =====");
            Console.WriteLine("→ AES 和 MD5 会同时运行,不是先后运行!\n");

            // 开始计时
            var totalSw = Stopwatch.StartNew();

            // ==================== 核心 ====================
            // Parallel.Invoke = 同时执行多个方法(并行)
            // ==============================================
            Parallel.Invoke(
                () => GenerateAESKeys(),   // 任务1
                () => GenerateMD5Hashes()  // 任务2
            );

            totalSw.Stop();

            // 输出总时间
            Console.WriteLine("\n===== 运行完成 =====");
            Console.WriteLine("并行总耗时:" + totalSw.Elapsed);

            Console.WriteLine("\n按回车退出");
            Console.ReadLine();
        }
    }

https://github.com/deepmindd/Cppbooks/blob/main/C%2B%2B%20Concurrency%20in%20Action.pdf
https://github.com/anthonywilliams/ccia_code_samples
https://github.com/xiaoweiChen/Cpp_Concurrency_In_Action
https://github.com/jeremimucha/Cpp-Concurrency-In-Action-2nd-ed
https://github.com/iZhangHui/CCiA
https://github.com/ZouJiu1/multithread_Cplusplus
https://beefnoodles.cc/assets/book/C++%20Concurrency%20in%20Action.pdf
https://www.manning.com/books/concurrency-in-dot-net
https://github.com/subhajitchatterjee07/Concurrency-in-Python
https://github.com/concurrency-in-python-with-asyncio/concurrency-in-python-with-asyncio

https://www.wiley.com/en-us/Essential+Algorithms%3A+A+Practical+Approach+to+Computer+Algorithms+Using+Python+and+C%23%2C+2nd+Edition-p-9781119575993#downloadstab-section
https://ia803202.us.archive.org/31/items/python_ebooks_2020/%5BRod_Stephens%5D_Essential_Algorithms__A_Practical_A.pdf
https://github.com/Belowbelow/ComputerScienceBooks
https://github.com/GrindGold/pdf
https://github.com/SZU-ITer/CS-Books-PDF

https://github.com/jeremiahflaga/concurrency-in-csharp-cookbook-2e
https://www.packtpub.com/en-in/product/hands-on-parallel-programming-with-c-8-and-net-core-3-9781789132410/chapter/introduction-to-parallel-programming-2/section/introduction-to-parallel-programming-ch02lvl1sec02
https://github.com/wagnerhsu/packt-Parallel-Programming-and-Concurrency-with-C-sharp-10-and-.NET-6/
https://github.com/Apress/Parallel-Programming-with-CSharp-and-.NET

哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)生存.---Geovin Du(涂聚文)