C++20 STL Features: 1 Year of Development on GitHub
can't modify elements • const spancan't be reassigned, can modify elements • MSVC's std::span checks debug; gsl::span always23 Contiguous Range Constructor • GH-142, GH-500, GH-587 implemented by preserving ABI • Every PR is extensively reviewed by 2 maintainers • Keeps code at production quality: always ready to ship • Helps the team understand the code and related features33 Code Review Philosophy an incredible amount of time • Our parallelize tool runs it quickly, only on C++ files • Failed checks display the edits that clang-format wants • Building all architectures is very fast • Testing x86/x64 0 码力 | 45 页 | 702.09 KB | 5 月前3Rust 异步并发框架在移动端的应用 - 陈明煜
priority and quality of service 任务优先级调度 Linux CFS 调度 : 线程优先级 • 设置线程的 Nice 值给予线程不同的权重 2 个线程 A 和 B 。 A 的权重是 1024 , B 的权重是 2048 。那么 A 获得 CPU 的时间比例是 1024/ (1024 + 2048) = 33.3% Task priority and quality of service 对框架内的工作线程设置优先级,使其 拥有不同权重。 • 由 Kernel 决定调度时间 • 高优先级任务由高权重线程调度, 以此获得更多执行时间 • 全局队列区分高低优先级 Task priority and quality of service 高权重线程 低权重线程 task …. task …. Global queue task Local queue task Local queue Core Worker Worker 任务优先级调度 根据工作线程的优先级进行绑核(大小核) • 高优先级任务在大核执行,高性能 • 低优先级任务在小核执行,节省能耗 Task priority and quality of service Big Core Little Core 高优先级线程 低优先级线程 普通优先级线程 Set core-affinity IO & CPU 融合 北向接口融合:异步并行迭代器0 码力 | 25 页 | 1.64 MB | 1 年前3Finding Bugs using Path-Sensitive Static Analysis
survey https://aka.ms/cppconAgenda • Intro to path-sensitive static analysis • Path-sensitive checks in MSVC • A look under the hood • Upcoming features • Lessons learned2012 2014 2015 2016 2017 Path-sensitive • Use after move • Concurrency checks • Variant clear • Enum Index • HResult • Nullptr dereference • more to come.. Flow-sensitive • Coroutine lifetime checks • Most of CppCoreChecks • Pointer safety cost • We are actively looking into ways to make analysis more precise • There are a large set of checks in MSVC • Making intent explicit can help analysis, improve readabilityEnjoy the rest of the conference0 码力 | 35 页 | 14.13 MB | 5 月前3C++23: An Overview of Almost All New and Updated Features
Heterogeneous Erasure Removed Features Garbage Collection Support53 basic_string(_view)::contains() Checks if a string contains another string Example: std::string haystack{ "Hello World!" }; std::println("{}" count; i++) { // Not optimal: // - Writes 'count' nulls // - Updates size and checks for potential resize 'count' times result.append(pattern); } return result; }59 Garbage Collection Support68 Changes to Ranges Library ranges::starts_with() / ranges::ends_with() Checks if the start/end of a range matches another range E.g.: std::vector v1{ 11, 22, 33, 44 }; std::vector0 码力 | 105 页 | 759.96 KB | 5 月前3Автоматизация управления ClickHouse-кластерами в Kubernetes
изменений CRD ● Автоматизация ‘canary testing’ ● Интеграция с ZooKeeper operator ● Сложные health checks ● Jobs: ● Replica re-provisioning ● Backups ● Re-sharding Оно того стоит? Что получаем? ● Упрощение0 码力 | 44 页 | 2.24 MB | 1 年前3Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!
new_ccb)) if (old_ccb.ctrl != prev_ccb.ctrl) { ??? } } Disclaimer: Slide code omits some nullptr checks to save space. atomic> What happens when a concurrent operation changes the 0 码力 | 45 页 | 5.12 MB | 5 月前3Working with Asynchrony Generically: A Tour of C++ Executors
::SetConsoleCtrlHandler(&consoleHandler,FALSE); ( l ) CTRL-C SENDER (WINDOWS-SPECIFIC) consoleHandler() checks if there is a pending completion. If so, it completes it. The constructor registers the control0 码力 | 121 页 | 7.73 MB | 5 月前3
共 7 条
- 1