Working with Asynchrony Generically: A Tour of C++ Executorsextensible way to specify where, how, and when work should happen … including some standard ones: an event loop, portable access to the system execution context, nursery for spawned work4 P2300: STD::EXECUTION them to be treated like a black box. goto is an unstructured control flow construct conditional loop function call goto59 FIRE-AND-FORGET TASK MODELS ARE UNSTRUCTURED Fire-and-forget work is like the result of `task` when both operations complete. // process input in a loop until the user interrupts: sender auto work_loop = unifex::stop_when( unifex::repeat_effect( processInput() ),0 码力 | 121 页 | 7.73 MB | 6 月前3
whats new in visual studioPreview 4 Release Candidate Visual Studio 2022 May 2021 Oct 2021 (today) You’re invited Launch Event 🚀 Monday, November 8th, 2021 🚀 8:30 AM PT https://aka.ms/vs2022lau nch Nov 2021 Pain-Free Upgrade available for now under /std:c++latest Visit https://aka.ms/cpp/20 for more details Developer inner-loop C++20 in Visual Studio Build Debug Edit Code Navigation ☑️� Linters ☑️� Colorization integration CMake is a first-class project system in Visual Studio Familiar edit-build-debug inner-loop • including MSVC and Clang-tidy squiggles & quick actions • Doxygen integration Target Windows, Linux0 码力 | 42 页 | 19.02 MB | 6 月前3
C++20: An (Almost) Complete Overviewbarriers std::atomic_ref Designated Initializers Spaceship Operator <=> Range-based for Loop Initializer Non-Type Template Parameters [[likely]] and [[unlikely]] Calendars & Timezones used for? They simplify implementing: Generators Asynchronous I/O Lazy computations Event driven applications17 Coroutines C++20 contains language additions to support coroutines Standard types include support for <=> vector, string, map, set, sub_match, … Example:53 Range-based for Loop Initializer Initializers for switch statements (C++17): struct Foo { int value; int result; };0 码力 | 85 页 | 512.18 KB | 6 月前3
C++高性能并行编程与优化 - 课件 - 17 由浅入深学习 map 容器(*it).first; // K 类型 • (*it).second;// V 类型 map 的遍历:用 C++17 range-based loop • 和 vector 等 STL 容器一样, map 也支持 C++17 的 range-based loop 语法进行遍历 。 • for (auto tmp: m) • 由于刚刚说了, map 真正的“元素类型”是 K-V 对,所以这里的 auto 的定义,里面只有两个成 员: • struct pair{ • T1 first; T2 second; • }; map 的遍历:用 C++17 range-based loop • 所以 for (auto tmp: m) 这里 tmp 的类型是 pair 。 • 如果要单独访问 K 或者 V 怎么办?我们看一下 pair 的定义,里面只有两个成 • 要把所有 K 打印出来,就是: • for (auto tmp: m) { • print(tmp.first); • } map 的遍历:用 C++17 range-based loop • 所以 for (auto tmp: m) 这里 tmp 的类型是 pair 。 • 如果要单独访问 K 或者 V 怎么办?我们看一下 pair 的定义,里面只有两个成 0 码力 | 90 页 | 8.76 MB | 1 年前3
绕过conntrack,使用eBPF增强 IPVS优化K8s网络性能from eBPF • No loop support in eBPF verifier (Linux 4.14) • #param unroll • Size limitation of BPF program <= 4096 • Move SNAT allocate port loop into IPVS kernel module • Bounded loop support in Linux Srcport=x Udp for AAAA Srcport=x Udp for A Srcport=x DROP • Solution • In eBPF code, add a loop to wrap port alloc and insert. • If insert fails, it will retry alloc.0 码力 | 24 页 | 1.90 MB | 1 年前3
C++高性能并行编程与优化 - 课件 - 07 深入浅出访存优化nblur 次跳跃,每次跳跃的距离是 nx ,从而 缓存容量需要有 nx*nblur 那么大,才能利用 全部的缓存,而小彭老师的一级缓存只有 32KB 大。 • 因此可以用循环分块( loop tiling ),将外部 两层循环变为 blockSize 为跨步的,而内部 则在区间 [xBase, xBase + blockSize) 上循环 。 循环分块:用图片来直观感受 BM_y_blur 只有其中一个被用上,不能很好的利用寄 存器资源。 使用 _mm_stream_ps 和 SIMD 指令,加速计算和直写 • 为了充分填满寄存器,我们把 t 循环和 offset 循环交换一下( loop-interchange ) ,把 offset 换到内层循环去。这样至少能 让四个寄存器同时在进行加法运算( xmm 寄存器最多有几个来着?总之也不能太多, 不然被编译器 spill 到内存就不好了),从 prefetching • 直写: streaming , write-through • 延迟隐藏: latency hiding • 陷入空转以等待内存: stall • 循环分块: loop-tiling , loop-blocking • 寄存器分块: unroll-and-jam , register-blocking • 寄存器压力: register pressure , register0 码力 | 147 页 | 18.88 MB | 1 年前3
C++20 STL Features: 1 Year of Development on GitHubvector-like: erase-remove idiom • list-like: remove/remove_if member functions • map-like: handwritten loop calling m.erase(iter) • Many potential hazards 🙀 • remove_if(v.begin(), v.end(), pred); 🐞 • v v.erase(remove_if(v.begin(), v.end(), pred)); 🐞 • Quadratic complexity vec.erase(iter) loop 🐞 • Invalidating iterators while looping 🐞 • Skipping elements while looping 🐞17 Uniform Container Erasure0 码力 | 45 页 | 702.09 KB | 6 月前3
基于Rust-vmm实现Kubernetes运行时lots of K8S production practice in Tencent Motivation https://kccncchina2018english.sched.com/event/FuLz/layers-of-isolation-in-kubernetes-tim-allclair-google Kubernetes has many layers of isolation vmm-vcpu: a hypervisor-agnostic abstraction for Virtual CPUs (vCPUs). rust-vmm • event-manager: abstractions for implementing event based systems. • linux-loader: parser and loader for vmlinux and bzImage images0 码力 | 27 页 | 34.17 MB | 1 年前3
Learning by Contributing to Rust Compiler - 陈于康an art Simple diagnostic is a good start Compiler is a teacher/friend [# 100502 Avoid infinite loop in function arguments checking] A trivial fix may require a lot of time ? Fix the bug of next_point0 码力 | 23 页 | 3.28 MB | 1 年前3
RustBelt - Rust 的形式化语义模型postcondition “Q”. {P} {Q} Logics {True} let x = 10 {x = 10} {x = 3} x += 1 {x = 4} {True} loop {} {False} Hoare Logic Logics P: x ↦ v Ownership We own “x”, and “x” points to “v”. Disjointness0 码力 | 21 页 | 2.63 MB | 1 年前3
共 24 条
- 1
- 2
- 3













