 Session Types in C++Language type The code Protocol description 1) generate code Write and verify protocol Use according to type Use type 44“Scribble” – for writing and verifying protocol module scribble.example example.Purchasing; type Session Types in C++Language type The code Protocol description 1) generate code Write and verify protocol Use according to type Use type 44“Scribble” – for writing and verifying protocol module scribble.example example.Purchasing; type- "QuoteRequest" from "Purchasing.xsd" as QuoteRequest; ... global protocol BuyGoods (role Buyer, role Seller) { quote(QuoteRequest) from Buyer to Seller; choice at Seller Language type The code Protocol description 1) Language type The code Protocol description 2) generate code Write the code Verify protocol Use type Infer type Extract protocol 46Three approaches 0 码力 | 89 页 | 1.55 MB | 6 月前3
 Template-Less Meta-Programmingstd::pair{"ftp"sv, protocol::FTP}, std::pair{"file"sv, protocol::FILE}, std::pair{"http"sv, protocol::HTTP}, std::pair{"ws"sv, protocol::WS}, std::pair{"wss"sv, protocol::WSS}, }; 8 / 58[Examples] std::pair{"ftp"sv, protocol::FTP}, std::pair{"file"sv, protocol::FILE}, std::pair{"http"sv, protocol::HTTP}, std::pair{"ws"sv, protocol::WS}, std::pair{"wss"sv, protocol::WSS}, }; template Template-Less Meta-Programmingstd::pair{"ftp"sv, protocol::FTP}, std::pair{"file"sv, protocol::FILE}, std::pair{"http"sv, protocol::HTTP}, std::pair{"ws"sv, protocol::WS}, std::pair{"wss"sv, protocol::WSS}, }; 8 / 58[Examples] std::pair{"ftp"sv, protocol::FTP}, std::pair{"file"sv, protocol::FILE}, std::pair{"http"sv, protocol::HTTP}, std::pair{"ws"sv, protocol::WS}, std::pair{"wss"sv, protocol::WSS}, }; template- auto lookup(std::string_view) -> protocol; // Powered by TMP 8 / 58[Examples] Performance / Policies [Examples] Performance / Policies [1]: #uOps [2]: Latency [3]: RThroughput [4]: 0 码力 | 130 页 | 5.79 MB | 6 月前3
 Building Effective Embedded Systems: Architectural Best PracticesSeparation ⊡ Network Problems ⊡ External Interfaces ⊡ Simulators ⊡ Logs ⊡ MonitoringDesign your protocol and messages in a way you could always bounce back from a “bad” messageEmbedded Unit AEmbedded correctEasy to identify in memory⊡ Propriety protocol ⊡ Protobuf : ( https://protobuf.dev ) ⊡ CBOR : ( https://cbor.io ) ⊡ JSON ⊡ YAML Body structureDesign your protocol and messages in a way you could ⊡ Separate logic layer from hardware layer ⊡ Disconnect the logic from the network ⊡ Design your protocol in a way you could always bounce back from a “bad” message⊡ Use an operating system for complex0 码力 | 241 页 | 2.28 MB | 6 月前3 Building Effective Embedded Systems: Architectural Best PracticesSeparation ⊡ Network Problems ⊡ External Interfaces ⊡ Simulators ⊡ Logs ⊡ MonitoringDesign your protocol and messages in a way you could always bounce back from a “bad” messageEmbedded Unit AEmbedded correctEasy to identify in memory⊡ Propriety protocol ⊡ Protobuf : ( https://protobuf.dev ) ⊡ CBOR : ( https://cbor.io ) ⊡ JSON ⊡ YAML Body structureDesign your protocol and messages in a way you could ⊡ Separate logic layer from hardware layer ⊡ Disconnect the logic from the network ⊡ Design your protocol in a way you could always bounce back from a “bad” message⊡ Use an operating system for complex0 码力 | 241 页 | 2.28 MB | 6 月前3
 Using Modern C++ to Build XOffsetDatastructureSu, XOffsetDatastructure, CppCon 2024 252.2 Current Solutions • The 2 Categories • MessagePack, Protocol Buffers, etc. • FlatBuffers, Cap’n Proto, etc. • Input, Output, and Process. // To better understand buffer. This transformation requires traversing and encoding all fields. • Both MessagePack and Protocol Buffers follow this approach. Fanchen Su, XOffsetDatastructure, CppCon 2024 28 Data Buffer2.2 structure. This conversion needs traversing and decoding all fields. • Both MessagePack and Protocol Buffers employ this method. Fanchen Su, XOffsetDatastructure, CppCon 2024 29 Data Buffer Memory0 码力 | 111 页 | 3.03 MB | 6 月前3 Using Modern C++ to Build XOffsetDatastructureSu, XOffsetDatastructure, CppCon 2024 252.2 Current Solutions • The 2 Categories • MessagePack, Protocol Buffers, etc. • FlatBuffers, Cap’n Proto, etc. • Input, Output, and Process. // To better understand buffer. This transformation requires traversing and encoding all fields. • Both MessagePack and Protocol Buffers follow this approach. Fanchen Su, XOffsetDatastructure, CppCon 2024 28 Data Buffer2.2 structure. This conversion needs traversing and decoding all fields. • Both MessagePack and Protocol Buffers employ this method. Fanchen Su, XOffsetDatastructure, CppCon 2024 29 Data Buffer Memory0 码力 | 111 页 | 3.03 MB | 6 月前3
 Monads in Modern C++— e.g., size() == 0 instead of has_value()? — Need to convert to the range protocol & then back to the maybe-like protocol • Just as we have range concept + algorithms — Can we not have the same for — e.g., size() == 0 instead of has_value()? — Need to convert to the range protocol & then back to the maybe-like protocol • Just as we have range concept + algorithms — Can we not have the same for algorithms/views possible ○ find(), and_then(), transform_or(), etc. ○ Exclusively for the maybe protocol! ● operator|() has 2 flavors: ○ If C and D are closure objects → C | D produces another closure0 码力 | 94 页 | 4.56 MB | 6 月前3 Monads in Modern C++— e.g., size() == 0 instead of has_value()? — Need to convert to the range protocol & then back to the maybe-like protocol • Just as we have range concept + algorithms — Can we not have the same for — e.g., size() == 0 instead of has_value()? — Need to convert to the range protocol & then back to the maybe-like protocol • Just as we have range concept + algorithms — Can we not have the same for algorithms/views possible ○ find(), and_then(), transform_or(), etc. ○ Exclusively for the maybe protocol! ● operator|() has 2 flavors: ○ If C and D are closure objects → C | D produces another closure0 码力 | 94 页 | 4.56 MB | 6 月前3
 Iteration Revisitedslide stride split take take_while unchecked zipITERATION REVISITED IMPLEMENTING THE SEQUENCE PROTOCOL template Iteration Revisitedslide stride split take take_while unchecked zipITERATION REVISITED IMPLEMENTING THE SEQUENCE PROTOCOL template- struct my_array { T data[N]; }; template - >); 34ITERATION REVISITED IMPLEMENTING THE SEQUENCE PROTOCOL template - struct my_array { T data[N]; struct flux_sequence_traits static_assert(flux�::multipass_sequence - >); 35ITERATION REVISITED IMPLEMENTING THE SEQUENCE PROTOCOL ▸ Considerably easier to implement vs STL ranges ▸ Even more so for higher sequence/range categories 0 码力 | 56 页 | 5.27 MB | 6 月前3
 deploying the networking TSback-end communicate with separate protocol Back-end implemented with Asio Queries serviced by proprietary database back-end (written in C++) 4 DataConn TCP protocol without login or encryption Intended to CLOSE_WAIT and TIME_WAIT in TCP 20 enum class async_control_reason { read, write, run, init, protocol }; struct async_control_statistics { std::size_t bytes_read; std::size_t bytes_written; std::size_t ctx, asio::ip::tcp::endpoint local) : acceptor(ctx), local(local) { acceptor.open(local.protocol()); acceptor.set_option(run_server::acceptor::reuse_address( true)); acceptor.bind(local);0 码力 | 44 页 | 892.77 KB | 6 月前3 deploying the networking TSback-end communicate with separate protocol Back-end implemented with Asio Queries serviced by proprietary database back-end (written in C++) 4 DataConn TCP protocol without login or encryption Intended to CLOSE_WAIT and TIME_WAIT in TCP 20 enum class async_control_reason { read, write, run, init, protocol }; struct async_control_statistics { std::size_t bytes_read; std::size_t bytes_written; std::size_t ctx, asio::ip::tcp::endpoint local) : acceptor(ctx), local(local) { acceptor.open(local.protocol()); acceptor.set_option(run_server::acceptor::reuse_address( true)); acceptor.bind(local);0 码力 | 44 页 | 892.77 KB | 6 月前3
 When Nanoseconds Matter: Ultrafast Trading Systems in C++munmap, shm_unlink, ftruncate, flock... struct ProtocolHeader { std::array When Nanoseconds Matter: Ultrafast Trading Systems in C++munmap, shm_unlink, ftruncate, flock... struct ProtocolHeader { std::array- PROTOCOL_NAME_MAX_LENGTH> protocol_name; uint64_t magic_number; uint64_t buffer_size; uint32_t major_version; uint32_t std::array - queue_size_bytes; uint8_t reserved[...]; // space for future protocol changes } __attribute__((aligned));76 Concurrent Queues Bounded? Blocking? # Consumers? Message 0 码力 | 123 页 | 5.89 MB | 6 月前3
 C++26 Preview[[maybe_unused]], c] = f(); return a + c; } https://godbolt.org/z/68WGq46dj 17in dra� P2819 Add tuple protocol to complex //before complex C++26 Preview[[maybe_unused]], c] = f(); return a + c; } https://godbolt.org/z/68WGq46dj 17in dra� P2819 Add tuple protocol to complex //before complex- c{…}; auto & [r, i]{reinterpret_cast - (c)}; 1 1 2 3 4 //after 5 complex - c{…}; 6 auto & [r, i]{c}; 7 18in dra� P2819 Add tuple protocol to complex //before complex - c{…}; auto & [r, i]{reinterpret_cast - (c)}; 1 2 0 码力 | 118 页 | 2.02 MB | 6 月前3
 Make Successor Build Systems: World Tour of Build SystemsofWill it CMake? 100%! We can combine Engflow's Remote Execution, which uses the same RE level protocol Bazel adopts, and tipi's single instance approach.Will it CMake?Will it CMake?Let's check !Thank0 码力 | 115 页 | 7.02 MB | 6 月前3 Make Successor Build Systems: World Tour of Build SystemsofWill it CMake? 100%! We can combine Engflow's Remote Execution, which uses the same RE level protocol Bazel adopts, and tipi's single instance approach.Will it CMake?Will it CMake?Let's check !Thank0 码力 | 115 页 | 7.02 MB | 6 月前3
共 86 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













