Real-time Programming with the C++ Standard Library - Timur Doumler - CppCon 2021

Real-time Programming with the C++ Standard Library - Timur Doumler - CppCon 2021

CppCon

2 года назад

56,410 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@scotthinton4610
@scotthinton4610 - 29.10.2023 00:55

If you want a mathematically predictable (true hard real time) system, don't use C++. End of story. Hopefully you work in a very large conglomerate, because it's gonna be expensive. In my experience, it is absolutely possible to achieve real-time behavior that's not mathematically deterministic due to the complexity of the system using C++ and PREEMPT_RT. In addition to everything else Timur covered in this excellent talk, it's a matter of what else you're running and how tight your deadlines are. Many hard real-time systems aren't even running an OS, or the OS they are running is certified hard-real time and $$$$$$$.

Ответить
@yyyy-uv3po
@yyyy-uv3po - 20.04.2023 10:11

We can add std::span to the list of useful std real-time-safe classes

Ответить
@SurfinScientist
@SurfinScientist - 22.12.2022 15:21

I learned a lot from this talk. Excellent presentation!

Ответить
@Luca-yy4zh
@Luca-yy4zh - 10.12.2022 04:35

This is a very interesting talk. I liked the pmr trick to avoid dynamic memory allocation.

Ответить
@yutubl
@yutubl - 21.11.2022 19:33

@ real time safe dynamic memory: pre-configured and pre-allocatable data structures capacity like string, containers (vectors, ...) etc. can be used. As often in real time programming this shifts work from runtime to compile time, so memory use measurements with a profiler gives information for the system memory capacity configuration, which is good to be also on the safe side.

Ответить
@raksipulikka
@raksipulikka - 18.10.2022 23:29

Really nice

Ответить
@batner
@batner - 18.08.2022 16:04

I love the way Timur's lectures change with the years.

Ответить
@robertasylar
@robertasylar - 25.07.2022 14:46

Great public speaking!

Ответить
@tomkirbygreen
@tomkirbygreen - 17.07.2022 08:55

This is a fabulous presentation, thank you ever so much Timur.

Ответить
@francescobenacci6611
@francescobenacci6611 - 03.07.2022 13:03

This is a great talk, and covering a subject which I didn't manage to find many good resources about. Can you recommend other resources that cover this topic? Or is the standard the only place to look into?

Ответить
@andik70
@andik70 - 27.05.2022 14:51

So stick to C?

Ответить
@bernadettetreual
@bernadettetreual - 15.05.2022 17:25

Why on earth would I use the STL in real-time scenarios. It's completely unsuitable (algorithms excluded) and figuring out whether I can use a piece from it takes me more time than rewriting it for real-time audio needs.

Ответить
@e1123581321345589144
@e1123581321345589144 - 03.03.2022 16:33

I'm not sure why you'd want to enter a try block if you don't want to throw exceptions. Isn't the whole point of that structure to guard against exceptions?

Ответить
@cmdlp4178
@cmdlp4178 - 23.02.2022 23:26

I suggest an additional (optional) parameter to the attribute:
[[realtime_safe(n*m)]] void do_sth(int* array2d, int n, int m);

In general attributes for runtime might be useful, which would allow more complex code analysis:


[[average_time(n*std::log(n)), worst_time(n*n)]] void sort(...);

I guess compilers could bubble up this attribute through callers, such that tools can show the runtime behavior of any function.

Ответить
@teddyzhai4442
@teddyzhai4442 - 15.02.2022 11:32

by definition, real-time does not equal to low-latency, although most of time people tend to use interchangeably. Real-time is a deterministic characteristic.

Ответить
@rocknroooollllll
@rocknroooollllll - 05.02.2022 08:47

Something else I do is overload operator new and assert() it is never called once everything is set
up. Thoughts?

Ответить
@rocknroooollllll
@rocknroooollllll - 05.02.2022 08:45

Why not just use std::vector and pre-allocate? Any reason why we should not do that?

Ответить
@stavb9400
@stavb9400 - 25.01.2022 17:05

Most important I think here is avoid using std containers ( or maybe with a custom preallocator ) , and anything else appart from atomic in multithreading . I did not know actually stdarray is allocated on the stack good info there .

Ответить
@dennisrkb
@dennisrkb - 22.01.2022 14:44

This guy has an unwarranted phobia of multi-threading. What guarantees are there that his beloved single thread won't be interrupted and re-scheduled by the OS? None. I'd rather make my app faster with multi-threading and thus more "realtime".

Ответить
@xequals-pc1wl
@xequals-pc1wl - 19.01.2022 02:02

In conclusion: Don't use C++.

Ответить
@nickm8134
@nickm8134 - 18.01.2022 21:44

This was an excellent talk - this topic is very rarely covered at this depth - extremely useful for my interest in C++ audio DSP on ARM - thank you.

Ответить
@bmutthoju8797
@bmutthoju8797 - 16.01.2022 20:51

It is a very good talk! Thank you.

Ответить
@jannhewi
@jannhewi - 12.01.2022 18:32

thanks Timur.

Ответить
@TNothingFree
@TNothingFree - 12.01.2022 18:26

You know it:s going to be a good presentation if Timur is presenting

Ответить
@richardvonlehe4581
@richardvonlehe4581 - 12.01.2022 01:58

There were a lot of primitives from the thread support library getting tossed out. I wish there was a bit more time spent going over why. Having worked in an RTOS environment, posting semaphores or a msg to a queue seems like a common thing to do from a high priority thread.

Ответить
@uran0
@uran0 - 11.01.2022 18:22

Great talk. This topic was definitely poorly covered in the past. Thank you.

Ответить
@dominichofer136
@dominichofer136 - 09.01.2022 18:57

Fantastic talk! The audio quality is great. Your talk has a constant level of abstraction, this makes it easy to follow and absorb. You mention where there are rabbit holes and give a summary of your findings, that's so efficient. Your slideware greatly supports your narrative, is short and precise. The overall narrative visits topic after topic, giving an overview, some examples, some details, some outlook (like inpace_function, static_vector) and mentions the standard or papers where useful. One of the best talks of CppCon 2021! I have nothing to do with audio but I enjoyed it beginning to end.

Ответить
@LucianoDato
@LucianoDato - 08.01.2022 01:16

Excellent talk! I would die to have a standard implementation of a lock free queue! It's time already!

Ответить
@drd7690
@drd7690 - 07.01.2022 22:32

Great talk, thank you.

Ответить
@ChrisM541
@ChrisM541 - 07.01.2022 21:21

Fascinating talk, thank you for this.
If applicable, and where the problem areas are 'small'/manageable, would writing those sections in assembly language give you your required predictive execution behaviour? Of course, it would help if kernel calls are not used, or if used, they don't re-introduce what you seek to prevent. We used to re-write specific (problematic) kernel routines in days gone by - mainly removing their general purpose nature for our specific use cases(and gaining significant speed and 100% behavioural predictability)...don't know how doable that is here/today. A damn shame if those days are gone. Today's abstraction is both good and bad (loss of control, predictability, etc)

Ответить
@urugulu1656
@urugulu1656 - 07.01.2022 20:34

the best true random number generator ive seen is a reverse polarity base emitter junction in a bjt with non connected collector connected to an ADC...

Ответить
@urugulu1656
@urugulu1656 - 07.01.2022 19:55

technically you could do algorithms that are linear or worse in time complexity if you know that your input is within a given range for that the time complexity is within the deadline (or rather some percentage thereof)

Ответить
@yorailevi6747
@yorailevi6747 - 07.01.2022 19:50

I am a little confused where can I find the slides for 2021?

Ответить
@babgab
@babgab - 07.01.2022 19:35

I find it sad that it's 2022 and Timur still has to dispel the "lambdas heap allocate" myth. Lambdas have been in the language for more than ten years at this point. How many CppCon talks pointing this out is it going to take before we can stop re-explaining all this?

Ответить
@thebasicmaterialsproject1892
@thebasicmaterialsproject1892 - 07.01.2022 18:21

great lecture especially if your into ableton vst plug ins like izotope or virtual instruments steinberg etc

Ответить