C++20: An (Almost) Complete Overviewallowed)16 Coroutines What are coroutines used for? They simplify implementing: Generators Asynchronous I/O Lazy computations Event driven applications17 Coroutines C++20 contains language 16 • 13:3077 Math Constants Following mathematical constants are defined: e, log2e, log10e pi, inv_pi, inv_sqrtpi ln2, ln10 sqrt2, sqrt3, inv_sqrt3 egamma phi In std::numbers78 0 码力 | 85 页 | 512.18 KB | 6 月前3
hazard pointer synchronous reclamationprotection duration (e.g., the user-defined fn is allowed to block or take long time) Asynchronous Reclamation • Asynchronous reclamation is invoked when the number of retired objects reaches some threshold: Michael Folly open-source library: github.com/facebook/folly under synchronization/Hazptr.h Is Asynchronous Reclamation Always Enough? delete ptr shutdown_resource_X() Hazard Pointer Synchronous Reclamation reclamation ~Foo() { use_resource_X (); } Foo* ptr = new Foo; Remove ptr Is Asynchronous Reclamation Always Enough? No Asynchronous reclamation: delete ptr Using unavailable resource X Hazard Pointer Synchronous0 码力 | 31 页 | 856.38 KB | 6 月前3
Working with Asynchrony Generically: A Tour of C++ Executorsconcurrency 2. Cancellation 3. An extended example3 GOALS FOR THE EXECUTORS PROPOSAL The vision: “An asynchronous analog of the STL” • A full suite of standard async algorithms based on real-world requirements: Libunifex: https://github.com/facebookexperimental/libunifex54 SUMMARY FROM PART 1 1. Vision: “An asynchronous analogue of the STL” 2. Some simple examples, intro to senders 3. The lifecycle of an async • Only algorithms that introduce concurrency need to handle cancellation. • Cancellation is asynchronous and cooperative. • Cancellation is best-effort No guarantee an operation will stop promptly0 码力 | 121 页 | 7.73 MB | 6 月前3
Rust 异步并发框架在移动端的应用 - 陈明煜chenmingyu4@huawei.com 华为 公共开发部 嵌入式软件能力中心 Applications of Rust Runtime in Mobile Overview of asynchronous Rust #1 Rust 异步简介 Ylong async runtime #3 Ylong Runtime 并发框架 目录 Table of Contents #2 社区并发框架介绍以及与移动端的不适配性 Introduction to third party Runtime crates and their incompatibility with mobile environment Rust 异步机制 Asynchronous Rust 异步并发框架是许多大型应用、系统具备的底层能力。 区别于多线程编程模型,它带来以下优势: 任务调度颗粒度更小,充分利用线程资源 更可控的线程数 单个任务资源占用:几十 await Waker asyn c Future Waker poll Syntax sugar wake await Rust 异步机制 Asynchronous Rust Rust 异步机制 Asynchronous Rust Waker Task Future task Queue wake Worker Future.poll() Reactor fd0 码力 | 25 页 | 1.64 MB | 1 年前3
使用硬件加速Tokio - 戴翔requests per second with minimal overhead. Fast async/await reduces the complexity of writing asynchronous applications. Paired with Tokio's utilities and vibrant ecosystem, writing applications is a0 码力 | 17 页 | 1.66 MB | 1 年前3
Analyzing MySQL Logs with ClickHousequery © 2018 Percona. 7 Clickhouse Answers • 10x+ times space reduction compared to Raw Text Log Files High Compression (column store + LZ4) • Typically 100x faster than MySQL on Single com/Altinity/clicktail Created by my friends at Altinity Replaced HoneyComb “Sender” with Clickhouse Added Audit Log Support Meet ClickTail © 2018 Percona. 14 Installing ClickTail • curl -s https://packagecloud To run as a service © 2018 Percona. 15 MySQL Logs Primer General Query Log Binary Log Slow Query Log Audit Log © 2018 Percona. 16 MySQL Audit Logs to ClickHouse © 2018 Percona. 17 When0 码力 | 43 页 | 2.70 MB | 1 年前3
谈谈MYSQL那点事1024M innodb_flush_log_at_trx _commit 1 0 0 代表日志只大约每秒写入日志文件并且日志文件 刷新到磁盘 ; 1 为执行完没执行一条 SQL 马上 commit; 2 代表日志写入日志文件在每次提交 后 , 但是日志文件只有大约每秒才会刷新到磁盘上 . 对速度影响比较大,同时也关系数据完整性 innodb_log_file_size 8M 512M innodb_buffer_pool_size 的 25% ,官方推荐是 innodb_buffer_pool_size 的 40-50%, 设置大 一点来避免在日志文件覆写上不必要的缓冲池刷新 行为 innodb_log_buffer_size 128K 64M 用来缓冲日志数据的缓冲区的大小 . 推荐是 8M , 官方推荐该值小于 16M ,最好是 1M-8M 之间 设计合理的数据表结构:适当的数据冗余 设计合理的数据表结构:适当的数据冗余 执行情况,是否锁表,查看相应的 SQL SQL 语句 语句 设置 设置 my.cnf my.cnf 中的 中的 long-query-time long-query-time 和 和 log-slow-queries log-slow-queries 能 能 够 够 记录服务器那些 记录服务器那些 SQL SQL 执行速度比较慢 执行速度比较慢 另外有用的几个查询: 另外有用的几个查询:0 码力 | 38 页 | 2.04 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 17 由浅入深学习 map 容器一棵有着 n 个元素的平衡二叉树,深 度只有 ceil(log(n+1)) 层。也就是说我们最多只需要 ceil(log(n+1)) 次大小判断,就能找到任 意一个数!因为算法复杂度可以忽略 +1 -1 这些小东西,所以 set 查找的最坏复杂度是 O(logn) ! 2 1 4 5 8 7 4 要找的数 ceil(log(6+1)) = 3 层 4 < ? 从 set 到 map 次就找到了目标。这还是最坏的情况,最好只需要 1 次就够了。 • 最坏的情况需要判断多少次?最坏不会超过树的深度,而一棵有着 n 个元素的平衡二叉树,深 度只有 ceil(log(n+1)) 层。也就是说我们最多只需要 ceil(log(n+1)) 次大小判断,就能找到任 意一个数!因为算法复杂度可以忽略 +1 -1 这些小东西,所以 set 查找的最坏复杂度是 O(1) ! 4 要找的数 从 unordered_set0 码力 | 90 页 | 8.76 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 10 从稀疏数据结构到量化数据类型的幂次方,即: 2, 4, 8, 16, 32 等 。 • 则: a / pow(2,n) = a >> n • 也就是说 a / b = a >> log2(b) • 其中 log2 表示取 2 的对数。 • 比如 b=8 ,则 log2(b)=3 ,因为 2^3 = b 。 • 比如 a / 8 可以改成 a >> 3 。 >> 2 = 位运算 >> 对负数的处理 signed0 码力 | 102 页 | 9.50 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 08 CUDA 开启的 GPU 编程rsqrtf , cbrtf , rcbrtf , powf , si nf , cosf , sinpif , cospif , sincosf , s incospif , logf , log2f , log10f , expf , exp2f , exp10f , tanf , atanf , asinf , acosf , fmodf , fabsf , fminf , fmax f 。0 码力 | 142 页 | 13.52 MB | 1 年前3
共 15 条
- 1
- 2













