У нас вы можете посмотреть бесплатно Printf and Non-Blocking C & C++ Logging for Debugging Concurrency Issues или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Welcome to WatchPoint! In today’s video, we dive deep into printf debugging, why it should be your last resort, and how to improve performance when debugging complex issues like race conditions. Printf debugging is often plagued by issues like the dreaded "Heisenbug," where adding print statements causes the problem to disappear due to timing changes. We explore a variety of techniques using printf, fprintf and sprintf functions in C. We begin by testing the performance of a simple printf function and compare it against more efficient methods, such as file-based fprintf and C++ streams. While file I/O improves the speed significantly (down to 250ns), we still face challenges with race conditions and thread synchronization. We then try spdlog, a C++ logging library that promises fast logging but struggles with performance as it also relies on mutexes for multithreaded environments. However, with a bit of work we can overcome these limitations and implement a non-blocking logging system that can handle concurrency more efficiently. We look at an alternative method using atomic operations and memory mapping (mmap). This approach significantly improves performance, particularly as the number of threads scales. But we go further still – and create our own logging library (L3: The Lightweight Logging Library) which gets to just 1 nanosecond per log message, providing a non-blocking logging mechanism with much better scalability. L3 is a lightweight logging library that eliminates string manipulation bottlenecks Lastly, we consider the potential of optimizing multi-core systems using multiple memory-mapped buffers to avoid atomic operations, leading to faster, non-blocking logging across multiple threads. This video is packed with valuable insights into printf debugging, race conditions, mutex, atomic operations, and non-blocking logging techniques for better performance in C and C++ programming. Don’t forget to like and subscribe for more content on debugging techniques, C tutorials, C++ logging, and performance optimizations. Key Topics Covered: Printf Debugging and its pitfalls Race Conditions and the Heisenbug Mutexes, Concurrency, and Mutual Exclusion Performance of printf(), sprintf(), and other logging methods Using atomic operations and file-backed mmaps for non-blocking logging spdlog C++ logging library and performance comparisons Introduction to L3 Lightweight Logging Library If you’re into debugging, C programming, C++ performance optimizations, and logging solutions, make sure you check out the L3 library and follow along with the experiments discussed in this video. Time Stamps: 0:00 – Introduction to printf debugging 2:00 – Performance benchmarking of printf() 4:00 – Using file-based logging for better performance 6:00 – Testing spdlog and its limitations 8:00 – Non-blocking logging using atomic operations 10:00 – Introduction to L3 and improvements 12:00 – Comparing L3 with traditional methods 14:00 – Conclusion and next steps for optimizing multithreaded logging 🔧 Tools and Libraries Mentioned: spdlog: https://github.com/gabime/spdlog L3 Logging Library: https://github.com/undoio/l3 mmap (Memory-mapped I/O) Checkout other concurrency, printf debugging and c++ logging videos on the Undo channel, where you can find additional content on debugging techniques. For more information or to try out Undo for free on your own code, visit: https://undo.io #cpp #cplusplus #cprogramming #debugging #printf #cppprogramming #concurrency #multithreading #mutex #clanguage #library