SlideShare une entreprise Scribd logo
1  sur  37
Your systems. Working as one.
Sumant Tambe, PhD
Principal Research Engineer and Microsoft VC++ MVP
Real-Time Innovations, Inc.
@sutambe
SFBay Association of C/C++ Users
Jan 13, 2016
Polyglot Programming DC
Mar 16, 2016
7/9/2017 © 2015 RTI 2
Alternative Title
Why should you care?
• Most software written today relies on networking and I/O
• Simplify writing I/O-oriented software
– Correct (bug-free)
– Performs well
• Non-blocking
• Latency-aware
• Multi-core scalable
– Expressive–Simple and direct expression of intent
– Easy to write and read (maintainable)
– Productivity
• Modular
• Reusable
• Extensible
– and have fun while doing that!
7/9/2017 © 2015 RTI 4
Agenda
• Remote Procedure call (RPC) over DDS (DDS-RPC)
standard
• Deep dive into asynchronous programming
– future<T> examples
– C++ await examples
– Abusing C++ await to avoid if-then-else boilerplate
– C++ generator examples
• Composing abstractions
7/9/2017 © 2015 RTI 5
7/9/2017 © Real-Time Innovations, Inc. 6
Data Connectivity Standard for the Industrial IoT
DDS: Data Connectivity Standard for the
Industrial IoT
© 2009 Real-Time Innovations, Inc.
Streaming
Data
Sensors Events
Real-Time
Applications
Enterprise
Applications
Actuators
The DDS Standard Family
8
DDS v 1.4
RTPS v2.2
DDS-SECURITY
DDS-XTYPES
Application
UDP TCP** DTLS** TLS**
DDS-C++ DDS-JAVA* DDS-IDL-C DDS-IDL-C#
SHARED-
MEMORY**IP
DDS-WEB
HTTP(s)
IDL4.0
© 2015 RTI
DDS-RPC*
DDS-RPC
• Remote Procedure Call over
DDS Pub-Sub Middleware
• Adopted OMG specification
• C++ and Java
• Two language bindings
– Request/Reply
– Function-call
• Reference Implementation
– dds-rpc-cxx RTI github
7/9/2017 © 2015 RTI 9
RobotControl IDL Interface
7/9/2017 © 2015 RTI 10
module robot {
exception TooFast {};
enum Command { START_COMMAND, STOP_COMMAND };
struct Status {
string msg;
};
@DDSService
interface RobotControl
{
void command(Command com);
float setSpeed(float speed) raises (TooFast);
float getSpeed();
void getStatus(out Status status);
};
}; // module robot
RobotControl Abstract Class
7/9/2017 © 2015 RTI 11
class RobotControl
{
public:
virtual void command_async(const robot::Command & command) = 0;
// returns old speed when successful
virtual float setSpeed_async(float speed) = 0;
virtual float getSpeed_async() = 0;
virtual robot::RobotControl_getStatus_Out getStatus_async() = 0;
virtual ~RobotControl() { }
};
Synchronous calls
7/9/2017 © 2015 RTI 12
robot::RobotControlSupport::Client
robot_client(rpc::ClientParams().domain_participant(...)
.service_name("RobotControl"));
float speed = 0;
try
{
speed = robot_client.getSpeed();
speed += 10;
robot_client.setSpeed(speed);
}
catch (robot::TooFast &)
{
printf("Going too fast!n");
}
How well do you know latency?
7/9/2017 © 2015 RTI 13
Action Latency
Execute a typical instruction 1 second
Fetch from L1 cache memory 0.5 second
Branch misprediction 5 seconds
Fetch from L2 cache memory 7 seconds
Mutex lock/unlock 30 seconds
Fetch from main memory 1.5 minutes
Send 2K bytes over 1Gbps network 5.5 hours
Read 1 MB sequentially from memory 3 days
Fetch from new disk location (seek) 13 weeks
Read 1MB sequentially from disk 6.5 months
Send packet from US to Europe and back 5 years
Credit: http://www.coursera.org/course/reactive week 3-2
Latency Numbers Every Programmer Should Know (jboner)
https://gist.github.com/jboner/2841832
Assume a typical instruction takes 1 second…
Making Latency Explicit … as an Effect
7/9/2017 © 2015 RTI 14
class RobotControlAsync
{
public:
virtual rpc::future<void> command_async(const robot::Command & command) = 0;
// returns old speed when successful
virtual rpc::future<float> setSpeed_async(float speed) = 0;
virtual rpc::future<float> getSpeed_async() = 0;
virtual rpc::future<robot::RobotControl_getStatus_Out> getStatus_async() = 0;
virtual ~RobotControlAsync() { }
};
When rpc::future is C++11 std::future
7/9/2017 © 2015 RTI 15
try {
dds::rpc::future<float> speed_fut =
robot_client.getSpeed_async();
// Do some other stuff
while(speed_fut.wait_for(std::chrono::seconds(1)) ==
std::future_status::timeout);
speed = speed_fut.get();
speed += 10;
dds::rpc::future<float> set_speed_fut =
robot_client.setSpeed_async(speed);
// Do even more stuff
while(set_speed_fut.wait_for(std::chrono::seconds(1)) ==
std::future_status::timeout);
set_speed_fut.get();
}
catch (robot::TooFast &) {
printf("Going too fast!n");
}
Limitations of C++11 std::future<T>
• Must block (in most cases) to retrieve the result
• If the main program isn’t blocked, it’s likely that
the continuation is blocked
– I.e., the async result is available but no one has
noticed
• The programmer must do correlation of requests
with responses
– The order in which async result will be ready is not
guaranteed by DDS-RPC (when multiple requests are
outstanding)
7/9/2017 © 2015 RTI 16
When rpc::future is C++11 std::future
7/9/2017 © 2015 RTI 17
Composable Futures to Rescue
• Concurrency TS/C++17
• Serial Composition
– future.then()
• Parallel composition
– when_all, when_any
• Lot of implementations
– Boost.future, Microsoft PPL, HPX, Facebook’s Folly
– dds::rpc::future<T> wraps PPL (code)
7/9/2017 © 2015 RTI 18
Using future.then()
7/9/2017 © 2015 RTI 19
robot_client
.getSpeed_async()
.then([robot_client](future<float> && speed_fut) {
float speed = speed_fut.get();
printf("getSpeed = %fn", speed);
speed += 10;
return robot_client.setSpeed_async(speed);
})
.then([](future<float> && speed_fut) {
try {
float speed = speed_fut.get();
printf("speed set successfully.n");
}
catch (robot::TooFast &) {
printf("Going too fast!n");
}
});
Improvements over C++11 future
• Main thread does not have to block
• Callback (continuation) does not have to block
– The thread setting the future value invokes the
callback right away
• Request/Reply correlation isn’t explicit because
the callback lambda captures the necessary state
– No incidental data structures necessary (state
machines, std::map) for request/reply correlation
(see Sean Parent’s CppCon’15 talk about no incidental data structures)
• Same pattern in Javascript promises and other
places
7/9/2017 © 2015 RTI 20
7/9/2017 © 2015 RTI 21
Speed up the robot to MAX_SPEED
in increments of 10 and without
blocking
7/9/2017 © 2015 RTI 22
dds::rpc::future<float> speedup_until_maxspeed(
robot::RobotControlSupport::Client & robot_client)
{
static const int increment = 10;
return
robot_client
.getSpeed_async()
.then([robot_client](future<float> && speed_fut) {
float speed = speed_fut.get();
speed += increment;
if(speed <= MAX_SPEED) {
printf("speedup_until_maxspeed: new speed = %fn", speed);
return robot_client.setSpeed_async(speed);
}
else
return dds::rpc::details::make_ready_future(speed);
})
.then([robot_client](future<float> && speed_fut) {
float speed = speed_fut.get();
if(speed + increment <= MAX_SPEED)
return speedup_until_maxspeed(robot_client);
else
return dds::rpc::details::make_ready_future(speed);
});
}
Return ready future?
Why not speed?
Is that recursive?
Does the stack grow?... No!
What are these lambdas doing here?
Is that a CPS transform? … Yes!
.then() in Action
7/9/2017 © 2015 RTI 23
Setup getSpeed Callback Receive getSpeed Reply and invoke setSpeed
Setup setSpeed Callback Receive setSpeed Reply and invoke
speedup_until_maxspeed
.then .then .then .then .then
speedup_until_maxspeed speedup_until_maxspeed speedup_until_maxspeed
What’s Wrong with .then()
• Control-flow is awkward
– The last example shows that async looping is hard
• Debugging is hard
– No stack-trace (at least not very useful)
– See screenshots
– .then is stitching together lambdas (program
fragments). Not seamless.
– Awkward physical and temporal continuity
7/9/2017 © 2015 RTI 24
Welcome C++ Coroutines
7/9/2017 © 2015 RTI 25
Using C++ await
7/9/2017 © 2015 RTI 26
dds::rpc::future<void> test_iterative_await(
robot::RobotControlSupport::Client & robot_client)
{
static const int inc = 10;
float speed = 0;
while ((speed = await robot_client.getSpeed_async())+inc <= MAX_SPEED)
{
await robot_client.setSpeed_async(speed + inc);
printf("current speed = %fn", speed + inc);
}
}
Synchronous-looking but completely non-blocking code
C++ await Examples in Visual Studio 2015
• test_await
• test_iterative_await
• test_three_getspeed_await
• test_three_setspeed_await
• test_lambda_await
• test_foreach_await
• test_accumulate_await
• test_lift_accumulate_await
code on github (robot_func.cxx)
7/9/2017 © 2015 RTI 27
Awaitable Types
• Many, many possibilities. You define the semantics.
• A pair of types
– Promise and Future
• Awaitable Implements
– await_ready
– await_suspend
– await_resume
– type::promise_type
• Promise Implements
– get_return_object
– initial_suspend
– final_suspend
– set_exception
– return_value
7/9/2017 © 2015 RTI 28
C++ Generators
7/9/2017 © 2015 RTI 32
• Synchronous generator (yield) is syntax
sugar for creating lazy containers
• std::experimental::generator<T>
– movable
• Many more possibilities
C++ Generators
7/9/2017 © 2015 RTI 33
• Synchronous generator (yield) is syntax
sugar for creating lazy containers
void test_hello()
{
for (auto ch: hello())
{
std::cout << ch;
}
}
std::experimental::generator<char>
hello()
{
yield 'H';
yield 'e';
yield 'l';
yield 'l';
yield 'o';
yield ',';
yield ' ';
yield 'w';
yield 'o';
yield 'r';
yield 'l';
yield 'd';
}
Generator Iterator Category
• What is it?
7/9/2017 © 2015 RTI 34
std::input_iterator_tag
Deterministic Resource Cleanup
7/9/2017 © 2015 RTI 35
std::experimental::generator<std::string>
read_file(const std::string & filename)
{
std::fstream in(filename);
std::string str;
while (in >> str)
yield str;
}
void test_read_file(const std::string filename)
{
{
auto & generator = read_file(filename);
for (auto & str : generator)
{
std::cout << str << " ";
break;
}
std::cout << "n";
}
// file closed before reaching here
}
C++ Generators
7/9/2017 © 2015 RTI 36
• Generators preserve the local variable and
arguments
void test_range()
{
for (auto i: range(1, 10))
{
std::cout << i;
}
}
std::experimental::generator<int> range(int start, int count)
{
if (count > 0) {
for (int i = 0; i < count; i++)
yield start + i;
}
}
Recursive?
7/9/2017 © 2015 RTI 37
std::experimental::generator<int> range(int start, int count)
{
if (count > 0) {
yield start;
for (auto i : range(start + 1, count - 1))
yield i;
}
}
• Crashes at count ~3000
– Quadratic run-time complexity
– i-th value yields i times
• “Regular” generators can’t suspend nested stack frames
– Use recursive_generator<T>
Composing Abstractions
• A cool way to compose generators is….
7/9/2017 © 2015 RTI 38
range-v3
• But range-v3 did not compile on VS2015
– So I’ll use my own generators library
– See my Silicon Valley Code Camp 2015 talk
• Composable Generators and Property-based Testing (video, slides)
– You can use boost.range if you like
• A cool way to compose lazy containers is….
Composing Generators
7/9/2017 © 2015 RTI 39
#include “generator.h” // See my github
std::experimental::generator<char> hello()
{
for (auto ch : "HELLO WORLD")
yield ch;
}
void test_coroutine_gen()
{
std::string msg = “hello@world";
auto gen = gen::make_coroutine_gen(hello)
.map([](char ch) { return char(ch + 32); })
.take(msg.size());
int i = 0;
for (auto ch: gen)
{
std::cout << ch;
assert(ch == msg[i++]);
}
}
Generator and Synchrony are Orthogonal
• Yellow Boxes
– Libraries already exist (e.g., range-v3, future::then, RxCpp)
• Not really easy
– The C++ Resumable Functions proposal adds language-level support
• Like many other languages: Javascript, Dart, Hack, C#, etc.
7/9/2017 © 2015 RTI 40
Sync/Async, One/Many
Single Multiple
Sync T generator<T>::iterator
Async future<T> async_generator<T>
See Spicing Up Dart with Side Effects - ACM Queue
--- Erik Meijer, Applied Duality; Kevin Millikin, Google; Gilad Bracha, Google
Further Reading
• Resumable Functions in C++:
http://blogs.msdn.com/b/vcblog/archive/2014/11/12/resuma
ble-functions-in-c.aspx
• Resumable Functions (revision 4)---Gor Nishanov, Jim Radigan
(Microsoft) N4402
• Spicing Up Dart with Side Effects - ACM Queue --- Erik Meijer,
Applied Duality; Kevin Millikin, Google; Gilad Bracha, Google
7/9/2017 © 2015 RTI 41

Contenu connexe

Tendances

Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesHùng Nguyễn Huy
 
RxJS Operators - Real World Use Cases - AngularMix
RxJS Operators - Real World Use Cases - AngularMixRxJS Operators - Real World Use Cases - AngularMix
RxJS Operators - Real World Use Cases - AngularMixTracy Lee
 
Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular Jalpesh Vadgama
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocationViji B
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJSBrainhub
 
Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Fabio Biondi
 
JavaScript: Operators and Expressions
JavaScript: Operators and ExpressionsJavaScript: Operators and Expressions
JavaScript: Operators and ExpressionsLearnNowOnline
 
RXJS Best (& Bad) Practices for Angular Developers
RXJS Best (& Bad) Practices for Angular DevelopersRXJS Best (& Bad) Practices for Angular Developers
RXJS Best (& Bad) Practices for Angular DevelopersFabio Biondi
 
Introducing Async/Await
Introducing Async/AwaitIntroducing Async/Await
Introducing Async/AwaitValeri Karpov
 
Loops Basics
Loops BasicsLoops Basics
Loops BasicsMushiii
 
Java 8 Default Methods
Java 8 Default MethodsJava 8 Default Methods
Java 8 Default MethodsHaim Michael
 
HTML5 Local Storage
HTML5 Local StorageHTML5 Local Storage
HTML5 Local StorageLior Zamir
 

Tendances (20)

Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
 
JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
RxJS Operators - Real World Use Cases - AngularMix
RxJS Operators - Real World Use Cases - AngularMixRxJS Operators - Real World Use Cases - AngularMix
RxJS Operators - Real World Use Cases - AngularMix
 
Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular Top 10 RxJs Operators in Angular
Top 10 RxJs Operators in Angular
 
Dynamic memory allocation
Dynamic memory allocationDynamic memory allocation
Dynamic memory allocation
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
Function in c
Function in cFunction in c
Function in c
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"
 
JavaScript: Operators and Expressions
JavaScript: Operators and ExpressionsJavaScript: Operators and Expressions
JavaScript: Operators and Expressions
 
Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
RXJS Best (& Bad) Practices for Angular Developers
RXJS Best (& Bad) Practices for Angular DevelopersRXJS Best (& Bad) Practices for Angular Developers
RXJS Best (& Bad) Practices for Angular Developers
 
Introducing Async/Await
Introducing Async/AwaitIntroducing Async/Await
Introducing Async/Await
 
Loops Basics
Loops BasicsLoops Basics
Loops Basics
 
Java 8 Default Methods
Java 8 Default MethodsJava 8 Default Methods
Java 8 Default Methods
 
Nested loops
Nested loopsNested loops
Nested loops
 
HTML5 Local Storage
HTML5 Local StorageHTML5 Local Storage
HTML5 Local Storage
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 

En vedette

Philips Big Data Expo
Philips Big Data ExpoPhilips Big Data Expo
Philips Big Data ExpoBigDataExpo
 
Sfeldman bbworld 07_going_enterprise (1)
Sfeldman bbworld 07_going_enterprise (1)Sfeldman bbworld 07_going_enterprise (1)
Sfeldman bbworld 07_going_enterprise (1)Steve Feldman
 
Global Azure Bootcamp - Azure OMS
Global Azure Bootcamp - Azure OMSGlobal Azure Bootcamp - Azure OMS
Global Azure Bootcamp - Azure OMSBruno Lopes
 
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VA
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VACleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VA
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VAClearedJobs.Net
 
Walmart Big Data Expo
Walmart Big Data ExpoWalmart Big Data Expo
Walmart Big Data ExpoBigDataExpo
 
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...Lucidworks
 
Opensource Search Engines
Opensource Search EnginesOpensource Search Engines
Opensource Search Enginescusy GmbH
 
Big data for cio 2015
Big data for cio 2015Big data for cio 2015
Big data for cio 2015Zohar Elkayam
 
Becoming the master of disaster... with asr
Becoming the master of disaster... with asrBecoming the master of disaster... with asr
Becoming the master of disaster... with asrnj-azure
 
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native MiddlewareTrends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native MiddlewareKai Wähner
 
DGIQ 2015 The Fundamentals of Data Quality
DGIQ 2015 The Fundamentals of Data QualityDGIQ 2015 The Fundamentals of Data Quality
DGIQ 2015 The Fundamentals of Data QualityCaserta
 
Business model cavans nl-sep-2014
Business model cavans nl-sep-2014Business model cavans nl-sep-2014
Business model cavans nl-sep-2014RolandSyntens
 
100 blue mix days technical training
100 blue mix days technical training100 blue mix days technical training
100 blue mix days technical trainingAjit Yohannan
 
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...liela_stunda
 
(SEC320) Leveraging the Power of AWS to Automate Security & Compliance
(SEC320) Leveraging the Power of AWS to Automate Security & Compliance(SEC320) Leveraging the Power of AWS to Automate Security & Compliance
(SEC320) Leveraging the Power of AWS to Automate Security & ComplianceAmazon Web Services
 
Generalized B2B Machine Learning by Andrew Waage
Generalized B2B Machine Learning by Andrew WaageGeneralized B2B Machine Learning by Andrew Waage
Generalized B2B Machine Learning by Andrew WaageData Con LA
 
General physicians and the adf Heddle
General physicians and the adf HeddleGeneral physicians and the adf Heddle
General physicians and the adf HeddleLeishman Associates
 
Docker containerization cookbook
Docker containerization cookbookDocker containerization cookbook
Docker containerization cookbookPascal Louis
 

En vedette (20)

Philips Big Data Expo
Philips Big Data ExpoPhilips Big Data Expo
Philips Big Data Expo
 
Sfeldman bbworld 07_going_enterprise (1)
Sfeldman bbworld 07_going_enterprise (1)Sfeldman bbworld 07_going_enterprise (1)
Sfeldman bbworld 07_going_enterprise (1)
 
Global Azure Bootcamp - Azure OMS
Global Azure Bootcamp - Azure OMSGlobal Azure Bootcamp - Azure OMS
Global Azure Bootcamp - Azure OMS
 
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VA
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VACleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VA
Cleared Job Fair Job Seeker Handbook June 15, 2017, Dulles, VA
 
Walmart Big Data Expo
Walmart Big Data ExpoWalmart Big Data Expo
Walmart Big Data Expo
 
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
Events Processing and Data Analysis with Lucidworks Fusion: Presented by Kira...
 
Opensource Search Engines
Opensource Search EnginesOpensource Search Engines
Opensource Search Engines
 
Big data for cio 2015
Big data for cio 2015Big data for cio 2015
Big data for cio 2015
 
Becoming the master of disaster... with asr
Becoming the master of disaster... with asrBecoming the master of disaster... with asr
Becoming the master of disaster... with asr
 
Voetsporen 38
Voetsporen 38Voetsporen 38
Voetsporen 38
 
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native MiddlewareTrends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
Trends at JavaOne 2016: Microservices, Docker and Cloud-Native Middleware
 
DGIQ 2015 The Fundamentals of Data Quality
DGIQ 2015 The Fundamentals of Data QualityDGIQ 2015 The Fundamentals of Data Quality
DGIQ 2015 The Fundamentals of Data Quality
 
Business model cavans nl-sep-2014
Business model cavans nl-sep-2014Business model cavans nl-sep-2014
Business model cavans nl-sep-2014
 
Understanding big data
Understanding big dataUnderstanding big data
Understanding big data
 
100 blue mix days technical training
100 blue mix days technical training100 blue mix days technical training
100 blue mix days technical training
 
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...
“Ūdens resursi. Saglabāsim ūdeni kopā!” Pasaules lielākā mācību stunda Daugav...
 
(SEC320) Leveraging the Power of AWS to Automate Security & Compliance
(SEC320) Leveraging the Power of AWS to Automate Security & Compliance(SEC320) Leveraging the Power of AWS to Automate Security & Compliance
(SEC320) Leveraging the Power of AWS to Automate Security & Compliance
 
Generalized B2B Machine Learning by Andrew Waage
Generalized B2B Machine Learning by Andrew WaageGeneralized B2B Machine Learning by Andrew Waage
Generalized B2B Machine Learning by Andrew Waage
 
General physicians and the adf Heddle
General physicians and the adf HeddleGeneral physicians and the adf Heddle
General physicians and the adf Heddle
 
Docker containerization cookbook
Docker containerization cookbookDocker containerization cookbook
Docker containerization cookbook
 

Similaire à C++ Coroutines

Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyftmarkgrover
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotXamarin
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realAkamai Developers & Admins
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealNicholas Jansma
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go BadSteve Loughran
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnelukdpe
 
When third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realWhen third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realCharles Vazac
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick RethansBachkoutou Toutou
 
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...eZ Systems
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
Python and trending_data_ops
Python and trending_data_opsPython and trending_data_ops
Python and trending_data_opschase pettet
 
Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Thomas Weise
 
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward
 
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward
 
Introduction to Meteor - revised edition
Introduction to Meteor - revised editionIntroduction to Meteor - revised edition
Introduction to Meteor - revised editionStephan Hochhaus
 
Fluentd - RubyKansai 65
Fluentd - RubyKansai 65Fluentd - RubyKansai 65
Fluentd - RubyKansai 65N Masahiro
 
On component interface
On component interfaceOn component interface
On component interfaceLaurence Chen
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoPeter Bittner
 
WinOps meetup April 2016 DevOps lessons from Microsoft \\Build\
WinOps meetup April 2016   DevOps lessons from Microsoft \\Build\WinOps meetup April 2016   DevOps lessons from Microsoft \\Build\
WinOps meetup April 2016 DevOps lessons from Microsoft \\Build\DevOpsGroup
 

Similaire à C++ Coroutines (20)

Near real-time anomaly detection at Lyft
Near real-time anomaly detection at LyftNear real-time anomaly detection at Lyft
Near real-time anomaly detection at Lyft
 
Advanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien PouliotAdvanced iOS Build Mechanics, Sebastien Pouliot
Advanced iOS Build Mechanics, Sebastien Pouliot
 
Fluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting realFluent 2018: When third parties stop being polite... and start getting real
Fluent 2018: When third parties stop being polite... and start getting real
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting Real
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go Bad
 
Overview Of Parallel Development - Ericnel
Overview Of Parallel Development -  EricnelOverview Of Parallel Development -  Ericnel
Overview Of Parallel Development - Ericnel
 
When third parties stop being polite... and start getting real
When third parties stop being polite... and start getting realWhen third parties stop being polite... and start getting real
When third parties stop being polite... and start getting real
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at  eZ Con...
Debugging Effectively in the Cloud - Felipe Fidelix - Presentation at eZ Con...
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Python and trending_data_ops
Python and trending_data_opsPython and trending_data_ops
Python and trending_data_ops
 
Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019Streaming your Lyft Ride Prices - Flink Forward SF 2019
Streaming your Lyft Ride Prices - Flink Forward SF 2019
 
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
 
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
Flink Forward San Francisco 2019: Streaming your Lyft Ride Prices - Thomas We...
 
Introduction to Meteor - revised edition
Introduction to Meteor - revised editionIntroduction to Meteor - revised edition
Introduction to Meteor - revised edition
 
Fluentd - RubyKansai 65
Fluentd - RubyKansai 65Fluentd - RubyKansai 65
Fluentd - RubyKansai 65
 
AMQP vs GRAPHITE
AMQP vs GRAPHITEAMQP vs GRAPHITE
AMQP vs GRAPHITE
 
On component interface
On component interfaceOn component interface
On component interface
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon Otto
 
WinOps meetup April 2016 DevOps lessons from Microsoft \\Build\
WinOps meetup April 2016   DevOps lessons from Microsoft \\Build\WinOps meetup April 2016   DevOps lessons from Microsoft \\Build\
WinOps meetup April 2016 DevOps lessons from Microsoft \\Build\
 

Plus de Sumant Tambe

Kafka tiered-storage-meetup-2022-final-presented
Kafka tiered-storage-meetup-2022-final-presentedKafka tiered-storage-meetup-2022-final-presented
Kafka tiered-storage-meetup-2022-final-presentedSumant Tambe
 
Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Sumant Tambe
 
Tuning kafka pipelines
Tuning kafka pipelinesTuning kafka pipelines
Tuning kafka pipelinesSumant Tambe
 
New Tools for a More Functional C++
New Tools for a More Functional C++New Tools for a More Functional C++
New Tools for a More Functional C++Sumant Tambe
 
C++ Generators and Property-based Testing
C++ Generators and Property-based TestingC++ Generators and Property-based Testing
C++ Generators and Property-based TestingSumant Tambe
 
Reactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxReactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxSumant Tambe
 
RPC over DDS Beta 1
RPC over DDS Beta 1RPC over DDS Beta 1
RPC over DDS Beta 1Sumant Tambe
 
Remote Log Analytics Using DDS, ELK, and RxJS
Remote Log Analytics Using DDS, ELK, and RxJSRemote Log Analytics Using DDS, ELK, and RxJS
Remote Log Analytics Using DDS, ELK, and RxJSSumant Tambe
 
Property-based Testing and Generators (Lua)
Property-based Testing and Generators (Lua)Property-based Testing and Generators (Lua)
Property-based Testing and Generators (Lua)Sumant Tambe
 
Reactive Stream Processing for Data-centric Publish/Subscribe
Reactive Stream Processing for Data-centric Publish/SubscribeReactive Stream Processing for Data-centric Publish/Subscribe
Reactive Stream Processing for Data-centric Publish/SubscribeSumant Tambe
 
Reactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and RxReactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and RxSumant Tambe
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Sumant Tambe
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Sumant Tambe
 
An Extensible Architecture for Avionics Sensor Health Assessment Using DDS
An Extensible Architecture for Avionics Sensor Health Assessment Using DDSAn Extensible Architecture for Avionics Sensor Health Assessment Using DDS
An Extensible Architecture for Avionics Sensor Health Assessment Using DDSSumant Tambe
 
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSOverloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSSumant Tambe
 
Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++Sumant Tambe
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeSumant Tambe
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 Sumant Tambe
 
Retargeting Embedded Software Stack for Many-Core Systems
Retargeting Embedded Software Stack for Many-Core SystemsRetargeting Embedded Software Stack for Many-Core Systems
Retargeting Embedded Software Stack for Many-Core SystemsSumant Tambe
 
Ph.D. Dissertation
Ph.D. DissertationPh.D. Dissertation
Ph.D. DissertationSumant Tambe
 

Plus de Sumant Tambe (20)

Kafka tiered-storage-meetup-2022-final-presented
Kafka tiered-storage-meetup-2022-final-presentedKafka tiered-storage-meetup-2022-final-presented
Kafka tiered-storage-meetup-2022-final-presented
 
Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++Systematic Generation Data and Types in C++
Systematic Generation Data and Types in C++
 
Tuning kafka pipelines
Tuning kafka pipelinesTuning kafka pipelines
Tuning kafka pipelines
 
New Tools for a More Functional C++
New Tools for a More Functional C++New Tools for a More Functional C++
New Tools for a More Functional C++
 
C++ Generators and Property-based Testing
C++ Generators and Property-based TestingC++ Generators and Property-based Testing
C++ Generators and Property-based Testing
 
Reactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and RxReactive Stream Processing in Industrial IoT using DDS and Rx
Reactive Stream Processing in Industrial IoT using DDS and Rx
 
RPC over DDS Beta 1
RPC over DDS Beta 1RPC over DDS Beta 1
RPC over DDS Beta 1
 
Remote Log Analytics Using DDS, ELK, and RxJS
Remote Log Analytics Using DDS, ELK, and RxJSRemote Log Analytics Using DDS, ELK, and RxJS
Remote Log Analytics Using DDS, ELK, and RxJS
 
Property-based Testing and Generators (Lua)
Property-based Testing and Generators (Lua)Property-based Testing and Generators (Lua)
Property-based Testing and Generators (Lua)
 
Reactive Stream Processing for Data-centric Publish/Subscribe
Reactive Stream Processing for Data-centric Publish/SubscribeReactive Stream Processing for Data-centric Publish/Subscribe
Reactive Stream Processing for Data-centric Publish/Subscribe
 
Reactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and RxReactive Stream Processing Using DDS and Rx
Reactive Stream Processing Using DDS and Rx
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
 
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
 
An Extensible Architecture for Avionics Sensor Health Assessment Using DDS
An Extensible Architecture for Avionics Sensor Health Assessment Using DDSAn Extensible Architecture for Avionics Sensor Health Assessment Using DDS
An Extensible Architecture for Avionics Sensor Health Assessment Using DDS
 
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSOverloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
 
Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++Standardizing the Data Distribution Service (DDS) API for Modern C++
Standardizing the Data Distribution Service (DDS) API for Modern C++
 
Communication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/SubscribeCommunication Patterns Using Data-Centric Publish/Subscribe
Communication Patterns Using Data-Centric Publish/Subscribe
 
C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012 C++11 Idioms @ Silicon Valley Code Camp 2012
C++11 Idioms @ Silicon Valley Code Camp 2012
 
Retargeting Embedded Software Stack for Many-Core Systems
Retargeting Embedded Software Stack for Many-Core SystemsRetargeting Embedded Software Stack for Many-Core Systems
Retargeting Embedded Software Stack for Many-Core Systems
 
Ph.D. Dissertation
Ph.D. DissertationPh.D. Dissertation
Ph.D. Dissertation
 

Dernier

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 

Dernier (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 

C++ Coroutines

  • 1. Your systems. Working as one. Sumant Tambe, PhD Principal Research Engineer and Microsoft VC++ MVP Real-Time Innovations, Inc. @sutambe SFBay Association of C/C++ Users Jan 13, 2016 Polyglot Programming DC Mar 16, 2016
  • 2. 7/9/2017 © 2015 RTI 2 Alternative Title
  • 3. Why should you care? • Most software written today relies on networking and I/O • Simplify writing I/O-oriented software – Correct (bug-free) – Performs well • Non-blocking • Latency-aware • Multi-core scalable – Expressive–Simple and direct expression of intent – Easy to write and read (maintainable) – Productivity • Modular • Reusable • Extensible – and have fun while doing that! 7/9/2017 © 2015 RTI 4
  • 4. Agenda • Remote Procedure call (RPC) over DDS (DDS-RPC) standard • Deep dive into asynchronous programming – future<T> examples – C++ await examples – Abusing C++ await to avoid if-then-else boilerplate – C++ generator examples • Composing abstractions 7/9/2017 © 2015 RTI 5
  • 5. 7/9/2017 © Real-Time Innovations, Inc. 6 Data Connectivity Standard for the Industrial IoT
  • 6. DDS: Data Connectivity Standard for the Industrial IoT © 2009 Real-Time Innovations, Inc. Streaming Data Sensors Events Real-Time Applications Enterprise Applications Actuators
  • 7. The DDS Standard Family 8 DDS v 1.4 RTPS v2.2 DDS-SECURITY DDS-XTYPES Application UDP TCP** DTLS** TLS** DDS-C++ DDS-JAVA* DDS-IDL-C DDS-IDL-C# SHARED- MEMORY**IP DDS-WEB HTTP(s) IDL4.0 © 2015 RTI DDS-RPC*
  • 8. DDS-RPC • Remote Procedure Call over DDS Pub-Sub Middleware • Adopted OMG specification • C++ and Java • Two language bindings – Request/Reply – Function-call • Reference Implementation – dds-rpc-cxx RTI github 7/9/2017 © 2015 RTI 9
  • 9. RobotControl IDL Interface 7/9/2017 © 2015 RTI 10 module robot { exception TooFast {}; enum Command { START_COMMAND, STOP_COMMAND }; struct Status { string msg; }; @DDSService interface RobotControl { void command(Command com); float setSpeed(float speed) raises (TooFast); float getSpeed(); void getStatus(out Status status); }; }; // module robot
  • 10. RobotControl Abstract Class 7/9/2017 © 2015 RTI 11 class RobotControl { public: virtual void command_async(const robot::Command & command) = 0; // returns old speed when successful virtual float setSpeed_async(float speed) = 0; virtual float getSpeed_async() = 0; virtual robot::RobotControl_getStatus_Out getStatus_async() = 0; virtual ~RobotControl() { } };
  • 11. Synchronous calls 7/9/2017 © 2015 RTI 12 robot::RobotControlSupport::Client robot_client(rpc::ClientParams().domain_participant(...) .service_name("RobotControl")); float speed = 0; try { speed = robot_client.getSpeed(); speed += 10; robot_client.setSpeed(speed); } catch (robot::TooFast &) { printf("Going too fast!n"); }
  • 12. How well do you know latency? 7/9/2017 © 2015 RTI 13 Action Latency Execute a typical instruction 1 second Fetch from L1 cache memory 0.5 second Branch misprediction 5 seconds Fetch from L2 cache memory 7 seconds Mutex lock/unlock 30 seconds Fetch from main memory 1.5 minutes Send 2K bytes over 1Gbps network 5.5 hours Read 1 MB sequentially from memory 3 days Fetch from new disk location (seek) 13 weeks Read 1MB sequentially from disk 6.5 months Send packet from US to Europe and back 5 years Credit: http://www.coursera.org/course/reactive week 3-2 Latency Numbers Every Programmer Should Know (jboner) https://gist.github.com/jboner/2841832 Assume a typical instruction takes 1 second…
  • 13. Making Latency Explicit … as an Effect 7/9/2017 © 2015 RTI 14 class RobotControlAsync { public: virtual rpc::future<void> command_async(const robot::Command & command) = 0; // returns old speed when successful virtual rpc::future<float> setSpeed_async(float speed) = 0; virtual rpc::future<float> getSpeed_async() = 0; virtual rpc::future<robot::RobotControl_getStatus_Out> getStatus_async() = 0; virtual ~RobotControlAsync() { } };
  • 14. When rpc::future is C++11 std::future 7/9/2017 © 2015 RTI 15 try { dds::rpc::future<float> speed_fut = robot_client.getSpeed_async(); // Do some other stuff while(speed_fut.wait_for(std::chrono::seconds(1)) == std::future_status::timeout); speed = speed_fut.get(); speed += 10; dds::rpc::future<float> set_speed_fut = robot_client.setSpeed_async(speed); // Do even more stuff while(set_speed_fut.wait_for(std::chrono::seconds(1)) == std::future_status::timeout); set_speed_fut.get(); } catch (robot::TooFast &) { printf("Going too fast!n"); }
  • 15. Limitations of C++11 std::future<T> • Must block (in most cases) to retrieve the result • If the main program isn’t blocked, it’s likely that the continuation is blocked – I.e., the async result is available but no one has noticed • The programmer must do correlation of requests with responses – The order in which async result will be ready is not guaranteed by DDS-RPC (when multiple requests are outstanding) 7/9/2017 © 2015 RTI 16
  • 16. When rpc::future is C++11 std::future 7/9/2017 © 2015 RTI 17
  • 17. Composable Futures to Rescue • Concurrency TS/C++17 • Serial Composition – future.then() • Parallel composition – when_all, when_any • Lot of implementations – Boost.future, Microsoft PPL, HPX, Facebook’s Folly – dds::rpc::future<T> wraps PPL (code) 7/9/2017 © 2015 RTI 18
  • 18. Using future.then() 7/9/2017 © 2015 RTI 19 robot_client .getSpeed_async() .then([robot_client](future<float> && speed_fut) { float speed = speed_fut.get(); printf("getSpeed = %fn", speed); speed += 10; return robot_client.setSpeed_async(speed); }) .then([](future<float> && speed_fut) { try { float speed = speed_fut.get(); printf("speed set successfully.n"); } catch (robot::TooFast &) { printf("Going too fast!n"); } });
  • 19. Improvements over C++11 future • Main thread does not have to block • Callback (continuation) does not have to block – The thread setting the future value invokes the callback right away • Request/Reply correlation isn’t explicit because the callback lambda captures the necessary state – No incidental data structures necessary (state machines, std::map) for request/reply correlation (see Sean Parent’s CppCon’15 talk about no incidental data structures) • Same pattern in Javascript promises and other places 7/9/2017 © 2015 RTI 20
  • 20. 7/9/2017 © 2015 RTI 21 Speed up the robot to MAX_SPEED in increments of 10 and without blocking
  • 21. 7/9/2017 © 2015 RTI 22 dds::rpc::future<float> speedup_until_maxspeed( robot::RobotControlSupport::Client & robot_client) { static const int increment = 10; return robot_client .getSpeed_async() .then([robot_client](future<float> && speed_fut) { float speed = speed_fut.get(); speed += increment; if(speed <= MAX_SPEED) { printf("speedup_until_maxspeed: new speed = %fn", speed); return robot_client.setSpeed_async(speed); } else return dds::rpc::details::make_ready_future(speed); }) .then([robot_client](future<float> && speed_fut) { float speed = speed_fut.get(); if(speed + increment <= MAX_SPEED) return speedup_until_maxspeed(robot_client); else return dds::rpc::details::make_ready_future(speed); }); } Return ready future? Why not speed? Is that recursive? Does the stack grow?... No! What are these lambdas doing here? Is that a CPS transform? … Yes!
  • 22. .then() in Action 7/9/2017 © 2015 RTI 23 Setup getSpeed Callback Receive getSpeed Reply and invoke setSpeed Setup setSpeed Callback Receive setSpeed Reply and invoke speedup_until_maxspeed .then .then .then .then .then speedup_until_maxspeed speedup_until_maxspeed speedup_until_maxspeed
  • 23. What’s Wrong with .then() • Control-flow is awkward – The last example shows that async looping is hard • Debugging is hard – No stack-trace (at least not very useful) – See screenshots – .then is stitching together lambdas (program fragments). Not seamless. – Awkward physical and temporal continuity 7/9/2017 © 2015 RTI 24
  • 25. Using C++ await 7/9/2017 © 2015 RTI 26 dds::rpc::future<void> test_iterative_await( robot::RobotControlSupport::Client & robot_client) { static const int inc = 10; float speed = 0; while ((speed = await robot_client.getSpeed_async())+inc <= MAX_SPEED) { await robot_client.setSpeed_async(speed + inc); printf("current speed = %fn", speed + inc); } } Synchronous-looking but completely non-blocking code
  • 26. C++ await Examples in Visual Studio 2015 • test_await • test_iterative_await • test_three_getspeed_await • test_three_setspeed_await • test_lambda_await • test_foreach_await • test_accumulate_await • test_lift_accumulate_await code on github (robot_func.cxx) 7/9/2017 © 2015 RTI 27
  • 27. Awaitable Types • Many, many possibilities. You define the semantics. • A pair of types – Promise and Future • Awaitable Implements – await_ready – await_suspend – await_resume – type::promise_type • Promise Implements – get_return_object – initial_suspend – final_suspend – set_exception – return_value 7/9/2017 © 2015 RTI 28
  • 28. C++ Generators 7/9/2017 © 2015 RTI 32 • Synchronous generator (yield) is syntax sugar for creating lazy containers • std::experimental::generator<T> – movable • Many more possibilities
  • 29. C++ Generators 7/9/2017 © 2015 RTI 33 • Synchronous generator (yield) is syntax sugar for creating lazy containers void test_hello() { for (auto ch: hello()) { std::cout << ch; } } std::experimental::generator<char> hello() { yield 'H'; yield 'e'; yield 'l'; yield 'l'; yield 'o'; yield ','; yield ' '; yield 'w'; yield 'o'; yield 'r'; yield 'l'; yield 'd'; }
  • 30. Generator Iterator Category • What is it? 7/9/2017 © 2015 RTI 34 std::input_iterator_tag
  • 31. Deterministic Resource Cleanup 7/9/2017 © 2015 RTI 35 std::experimental::generator<std::string> read_file(const std::string & filename) { std::fstream in(filename); std::string str; while (in >> str) yield str; } void test_read_file(const std::string filename) { { auto & generator = read_file(filename); for (auto & str : generator) { std::cout << str << " "; break; } std::cout << "n"; } // file closed before reaching here }
  • 32. C++ Generators 7/9/2017 © 2015 RTI 36 • Generators preserve the local variable and arguments void test_range() { for (auto i: range(1, 10)) { std::cout << i; } } std::experimental::generator<int> range(int start, int count) { if (count > 0) { for (int i = 0; i < count; i++) yield start + i; } }
  • 33. Recursive? 7/9/2017 © 2015 RTI 37 std::experimental::generator<int> range(int start, int count) { if (count > 0) { yield start; for (auto i : range(start + 1, count - 1)) yield i; } } • Crashes at count ~3000 – Quadratic run-time complexity – i-th value yields i times • “Regular” generators can’t suspend nested stack frames – Use recursive_generator<T>
  • 34. Composing Abstractions • A cool way to compose generators is…. 7/9/2017 © 2015 RTI 38 range-v3 • But range-v3 did not compile on VS2015 – So I’ll use my own generators library – See my Silicon Valley Code Camp 2015 talk • Composable Generators and Property-based Testing (video, slides) – You can use boost.range if you like • A cool way to compose lazy containers is….
  • 35. Composing Generators 7/9/2017 © 2015 RTI 39 #include “generator.h” // See my github std::experimental::generator<char> hello() { for (auto ch : "HELLO WORLD") yield ch; } void test_coroutine_gen() { std::string msg = “hello@world"; auto gen = gen::make_coroutine_gen(hello) .map([](char ch) { return char(ch + 32); }) .take(msg.size()); int i = 0; for (auto ch: gen) { std::cout << ch; assert(ch == msg[i++]); } }
  • 36. Generator and Synchrony are Orthogonal • Yellow Boxes – Libraries already exist (e.g., range-v3, future::then, RxCpp) • Not really easy – The C++ Resumable Functions proposal adds language-level support • Like many other languages: Javascript, Dart, Hack, C#, etc. 7/9/2017 © 2015 RTI 40 Sync/Async, One/Many Single Multiple Sync T generator<T>::iterator Async future<T> async_generator<T> See Spicing Up Dart with Side Effects - ACM Queue --- Erik Meijer, Applied Duality; Kevin Millikin, Google; Gilad Bracha, Google
  • 37. Further Reading • Resumable Functions in C++: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/resuma ble-functions-in-c.aspx • Resumable Functions (revision 4)---Gor Nishanov, Jim Radigan (Microsoft) N4402 • Spicing Up Dart with Side Effects - ACM Queue --- Erik Meijer, Applied Duality; Kevin Millikin, Google; Gilad Bracha, Google 7/9/2017 © 2015 RTI 41

Notes de l'éditeur

  1. Everything is distributed as an event (enables discovery): data object updates, a specific data-object existence and disposal, application startup, application shutdown, DR/DW creation/shutdown, topics and their types
  2. DDS provides an infrastructure for integrating real-time applications. It also facilitates integrating real-time applications with non-real-time (enterprise) applications, such as command and control systems.