Coroutines and Structured Concurrency in Practice## +24 ## Coroutines and Structured Concurrency in Practice ## DMITRY PROKOPTSEV ## Challenges when onboarding coroutines A lot of existing code mostly callback-based A custom-built I/O event loop • Easier object lifetime management • Easier error propagation But we need some structure ## Structured concurrency And why we care ## A typical async framework class Task { ... } represents a unit }); co_return visit(identity{}, v); } } ## Structured concurrency Tasks naturally form a "call tree" • coroutines • leaf awaitables (sleeping0 码力 | 103 页 | 1.98 MB | 1 年前3
Named Optional Parameters - JavaScript Stylelogger({one, two, three} = {}){ // in signature: = {} provides destructure // similar to structured binding // first check for what would be a "compiler" error if ( one == null ) throw members only ·designated initializers -- initializing a struct with: { .field = value } ·structured binding -- disaggregating a struct with: auto& [field1, field1] = myStruct ·function overloading Speed speed; }; Inside of processCarStateTransition the struct argument is spread with structured binding. Answer processCarStateTransition(const PathToChangingStatus& path) { auto& [car0 码力 | 1 页 | 3.17 MB | 1 年前3
PyArmor Documentation v8.5.10- 1.1.4. Obfuscating one package - 1.1.5. Expiring obfuscated scripts - 1.1.6. Binding obfuscated scripts to device - 1.1.7. Packaging obfuscated scripts - 1.1.8. Something 3.4. Copying.package data files - 1.3.5. Checking runtime key.periodically - 1.3.6. Binding to many machines - 1.3.7. Using outer file to store runtime key - 1.3.8. Localization 1. Distributing the obfuscated package • 1.1.5. Expiring obfuscated scripts • 1.1.6. Binding obfuscated scripts to device • 1.1.7. Packaging obfuscated scripts • 1.1.8. Something0 码力 | 193 页 | 154.05 KB | 1 年前3
Object Oriented ProgrammingProgramming RAINER GRIMM 20 21 October 24-29 ## Object-Oriented Programming Key Ideas Early and Late Binding Class Traps Virtuality Inheritance override final Polymorphism Template method Interfaces /destructor Shadowing Slicing Duck Typing ## Object-Oriented Programming Key Ideas Early and Late Binding Class Traps Virtuality Inheritance override final Polymorphism Template method Interfaces Separation from interface and implementation ## Object-Oriented Programming Key Ideas Early and Late Binding Class Traps Virtuality Inheritance override final Polymorphism Template method Interfaces0 码力 | 38 页 | 752.99 KB | 1 年前3
Working with Asynchrony Generically: A Tour of C++ Executorsconcurrent operation 5. Implementing a simple algorithm 6. Senders and coroutines ## Part 2: 1. Structured concurrency 2. Cancellation 3. An extended example ## GOALS FOR THE EXECUTORS PROPOSAL The vision: whether to use coroutines or not in the hands of the caller. ## COMING UP IN THE NEXT HOUR: Structured concurrency ## Cancellation support in sender/receiver Extended example: Sender/receiver and coroutines ## WHAT'S COMING IN PART 2 1. Structured concurrency 2. Cancellation support in the sender/receiver abstraction 3. An extended example ## Structured concurrence ##### I N THE BEGINNING ...0 码力 | 121 页 | 7.73 MB | 1 年前3
Sender Patterns to Wrangle Concurrency in Embedded Devicesto the state ## Raising the Level of Abstraction Enabled: • Structured concurrency • "Structured" debugging • "Structured" monitoring  as C++11, it contains a large number of small and beautiful languages and features (such as structured binding), and the appearance of these features once again corrects our programming paradigm in C++and etc. • ... and many more There are also other features such as parameter binding (C++11 provides std::bind and std::function), export etc. are also deprecated. These features mentioned 0 码力 | 92 页 | 1.79 MB | 2 年前3
C++26 Previewlanguage features ## Outline of the talk I • Language & Library • debugging • structured bindings • Language • Templates • Misc • Contracts • Reflection ## Outline s whether a program is running under the control of a debugger| Structured Bindings ## P0963 Structured binding declaration as a condition • use as conditions in if, while, for, and switch [to, ec] = std::to_chars(p, last, 42)) 12 { 13 auto s = std::string(p, to); 14 } ## P0963 Structured binding declaration as a condition • use as conditions in if, while, for, and switch statements •0 码力 | 118 页 | 2.02 MB | 1 年前3
The Lean Reference Manual
Release 3.3.03.4 Basic Data Types and Assertions 14 3.5 Constructors, Projections, and Matching 15 3.6 Structured Proofs 17 3.7 Computation 18 3.8 Axioms 19 4 Declarations 21 4.1 Declaration Names 21 6.1 Tactic Mode .45 6.2 Basic Tactics .46 6.3 Equality and Other Relations .49 6.4 Structured Tactic Proofs .49 6.5 Inductive Types .50 6.6 Tactic Combinators .53 6.7 The Rewriter {a b : Prop} : a ∧ b → b ∧ a := assume (ha, hb), ⟨hb, ha⟩ ### 3.6 Structured Proofs Syntactic sugar is provided for writing structured proof terms: • assume h : p, t is sugar for $ \lambda $ h : p,0 码力 | 67 页 | 266.23 KB | 2 年前3
Nim 2.0.8 Manualcharacter, enumeration (and subranges thereof) types) • floating-point types • string type ☐ structured types • reference (pointer) type • procedural type ☐ generic type ## Ordinal types Ordinal used in case statements like strings. ## Structured types A variable of a structured type can hold multiple values at the same time. Structured types can be nested to unlimited levels. Arrays, sequences, tuples, objects, and sets belong to the structured types. ## Array and sequence types Arrays are a homogeneous type, meaning that each element in the array has the same type. Arrays always0 码力 | 132 页 | 5.73 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
coroutinesstructured concurrencycallback-basedI/O event loopobject lifetime managementNamed Optional ParametersPOD structsdesignated initializersstructured bindingfunction overloadingpyarmorobfuscatingscriptsbindingprotectionEarly and Late BindingClassInheritanceVirtualityPolymorphismC++ ExecutorssendersreceiversSender PatternsConcurrencyEmbedded DevicesStructured ConcurrencyDebuggingModern C++C++11/14/17/20nullptrconstexprstructured bindingsC++26NetworkingReflectionRangesLeanVSCodeEmacstheorempackage managerGuardsLocksModule systemIdentifiersString type













