Tag: code

Purging Undefined Behavior & Intel Assumptions in a Legacy C++ Codebase – by Roth Michaels – CppCon 2022

https://cppcon.org/
---

Case Study: Purging Undefined Behavior and Intel Assumptions in a Legacy C++ Codebase - Roth Michaels - CppCon 2022
https://github.com/CppCon/CppCon2022

For large C++ codebases, adding support for a new platform (e.g. Apple Silicon/ARM) can be a scary, expensive endeavor. One of the biggest causes for alarm is undefined behavior (UB), which is an unfortunate part of many legacy codebases; luckily there are tools to help. After a brief review of what undefined behavior (UB) is we will discuss what issues it can cause and why it should be avoided. We will look at a few real-life bugs caused by UB in our codebase and discuss a common type of UB in legacy codebases: "it works on Intel". We’ll discuss how eliminating undefined behavior from a cross platform codebase can reduce maintenance costs and make it less stressful to support new platforms for your codebase. Then, we’ll go over the specific cultural and tooling initiatives we used to eliminate undefined behavior in our C++ codebase, including how we used static analysis and clang sanitizers to identify and address issues.
---

Roth Michaels

Roth Michaels is a Principal Software Engineer at iZotope/Soundwide, an industry leader in real-time audio software for music production and broadcast/film post-production. In his current role on the Audio Research Team at iZotope's parent company, Soundwide, he is focused on developing new fast prototyping frameworks. When he joined iZotope, Roth was the lead library designer of a new internal cross-platform "Glass", part of which is now available as open-source. More recently in his former role as Mix/Master Software Architect, Roth helped develop the reference implementation to move iZotope's products to subscription and led the team that launched the company’s first SaaS offering for music producers. Roth studied music composition at Brandeis University and continued his studies in the Dartmouth Digital Musics program. Roth began his career in software development writing software for his own compositions, and the works of other composers and artists, and teaching MaxMSP to composers and musicians; both private instruction and designing university courses. Before joining iZotope, he was working as a consultant for small startups working on mobile applications specializing in location services and Bluetooth.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #code

Filed under: UncategorizedTagged with: , , , , , ,

Scalable and Low Latency Lock-free Data Structures in C++ – by Alexander Krizhanovsky – CppCon 2022

https://cppcon.org/
---

Scalable and Low Latency Lock-free Data Structures in C++ - Alexander Krizhanovsky - CppCon 2022
https://github.com/CppCon/CppCon2022

Imagine that your program uses many threads, which insert and lookup millions times per second in a large data structure like std::map or std::unordered_map. Typically, you have to switch to a lock-free data structure for this task. Lock-free approaches perfectly scale data structures for multi-core systems, but hash tables and trees need some reorganization as more and more items are inserted and these reorganizations are hard to make lock-free. But the problem isn't only in contention and we also need to efficiently work with memory to develop a high performance data structure for the modern hardware. Cache conscious data structures address the problem by efficient usage of CPU caches and reducing the number of accesses to the main memory.

This talk makes a quick survey over several lock-free (primarily variations of hash table) and cache conscious (mostly trees) data structures. We'll discuss the best use cases for the data structures and their limitations. Besides performance in average cases, we'll also focus on worst case scenarios, which may introduce high tail latency on large busy systems. Tail, or high percentile, latency is a severe problem since it may reach significant values and the small percent of problem cases can be not so small in absolute values, e.g. if you service 1M users, then only 0.1% of them experiencing high processing time is a problem.

The main part of the talk is a step by step C++ implementation of Hash Trie, a hybrid lock-free cache conscious data structure, which provides good access time in average and worst case. We'll do microbenchmarks of the data structure and compare it with other data structures.

You'll learn about:
* when standard containers and locking mechanisms aren't enough
* several advanced data structures: split ordered lists and other variations of lock-free hash tables, tries (partricia trees) and hybrid data structures
* x86-64 memory ordering and cache hierarchy, operating system preemption and how to employ all the knowledge to implement a very fast data structure
* gotchas of data structures benchmarking, such as keys distribution, latency vs throughput, worst cases and so on
* an open source lock-free cache conscius Hash Trie implementation
---

Alexander Krizhanovsky

Alexander is the CEO of Tempesta Technologies, Inc., and is the architect of Tempesta FW, a high performance open source Linux application delivery controller. Alexander is responsible for the design and performance of several products in the areas of network traffic processing and databases. He designed the core architecture of a Web application firewall, mentioned in the Gartner Magic Quadrant '15, and the MariaDB temporal data tables.

Alexander gave talks at Netdev, SCALE, Linux Conf Australia, MariaDB user conferences, All Things Open, FOSDEM, Percona Live, IBM CASCON, and many other conferences. Alexander is also the author of a very fast lock-free MPMC ring buffer queue, published by the Linux Journal in 2013.
__

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #datastructures

Filed under: UncategorizedTagged with: , , , , ,

The Ride with WebAssembly: Taking Your C++ and Going Places – by Nipun Jindal & Pranay Kumar – CppCon 22

https://cppcon.org/
---

The Ride with WebAssembly : Taking Your C++ and Going Places - Nipun Jindal and Pranay Kumar - CppCon 2022
https://github.com/CppCon/CppCon2022

- You've heard of WebAssembly, and might have used it as well in web projects. This workshop explains tries to cover the good stuff that you would definitely need in the journey to expand your horizons on the web.

As C++ developers, we all wish to see a web application running core logic utilizing the same, almost cross-platform performant C++ source, No problem. As we know WebAssembly is an actual byte-code language one can compile your native code to instead. We'll discuss WebAssembly, and see how the magic of taking C++ code and turning it into executable code within the browser happens.

This workshop will explain well how WebAssembly works, how to use it, and how to build and use your WebAssembly modules from C++ code along with a demo. Important intermediary skills such as debugging, network communication, different types of file system access, and tweaks/caution needed would be provided in the workshop.

Additionally, possible dark places such as - threading issues, system calls tweaking, memory management would be covered as well. We would be taking a sample "Hello world", a sample (legacy vs modern) C++ project and would transform these for WebAssembly as part of the exercises along with some exercise at the end for regular, open-source C++ projects.

So grab C++ code, a modern browser, and let's get started!

Key Takeaways:

- You'll have the right footing you need to start building applications that feature WebAssembly.
- Have the vision to identify the web projects that may take advantage of C++ modules / libraries.
- Intermediate / Professional skills of WebAssembly
- Dark places / pitfalls of C++ WebAssembly development
---

Nipun Jindal

Nipun Jindal is a Senior Computer Scientist working at Adobe Systems. He has previously worked on multiple cross platform compatible desktop and mobile application like Flash, Adobe Photoshop, Adobe Capture, Adobe XD, developing his skill for cross platform development and eye for fast pace systems. His current set of responsibilities include moving the charter of fonts recommendation and fonts collaboration across different Adobe Creative Products. He is majorly interested in creating scalable systems with high performance. LinkedIn - https://www.linkedin.com/in/jindalnipun/

Pranay Kumar

Pranay Kumar is a Computer Scientist working in Adobe India with a passion for C++ development. He has been currently working towards utilizing the capabilities of emerging Adobe Fonts experience within the Adobe products. In the past several years with Adobe, he has contributed to the new licensing hybrid stack which is currently being used across the new version of Adobe Creative Cloud products such as Photoshop, Illustrator & InDesign, etc. His major interests lie in enabling the full potential of Adobe Fonts for consumers with modern C++ usage to ensure more secure, reliable & performant applications. Blog - https://medium.com/pranayaggarwal25 Website - http://pranayaggarwal.github.io/
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #webassembly

Filed under: UncategorizedTagged with: , , , , ,

C++ MythBusters – by Victor Ciura – CppCon 2022

https://cppcon.digital-medium.co.uk/tag/cppcon/">cppcon.org/
---

C++ MythBusters - Victor Ciura - CppCon 2022
https://github.com/CppCon/CppCon2022

The C++ community is very large and quite vocal when it comes to controversial issues.
We’re very fragmented on many topics, based on the breadth of the C++ ecosystem and the background/experience we each bring from our C++ niche.
From CppCoreGuidelines to opinionated best practices to established idioms, there’s a lot of good information easily available. Mixed up with all of this there are also plenty of myths. Some myths stem from obsolete information, some from bad teaching materials.
In this presentation, I will dissect a few of the most popular C++ myths to a level of detail not possible on Twitter… and without the stigma of newb/duplicate/eyeroll one might experience when asking these questions on StackOverflow.
Expect the familiar “Busted”, “Plausible”, or “Confirmed” verdicts on each myth and come prepared to chat about these.
---

Victor Ciura

Victor Ciura is a senior software engineer on the Visual C++ team, helping to improve the tools he’s been using for years. Before joining Microsoft, he programmed C++ professionally for 20 years, designing and implementing several core components & libraries of Advanced Installer, improving the virtualization and repackaging technologies for MSI/MSIX.

One of his hobbies is tidying-up and modernizing aging codebases and has been known to build open-source tools that help this process: Clang Power Tools.

He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on using modern C++, STL, algorithms and optimization techniques.

More details: @ciura_victor & https://ciura.ro & linkedin.com/victor-ciura
__

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

#cppcon.digital-medium.co.uk/tag/cppcon/">cppcon #cppcon.digital-medium.co.uk/tag/programming/">programming #cpp

Filed under: UncategorizedTagged with: , , , ,

C++ Lambda Idioms – by Timur Doumler – CppCon 2022

https://cppcon.org/
---

C++ Lambda Idioms - Timur Doumler - CppCon 2022
https://github.com/CppCon/CppCon2022

Ever since they were introduced in C++11, lambdas have been an essential language feature. Each subsequent standard added more functionality: we got generic lambdas and init captures in C++14, constexpr lambdas in C++17, default-construction and assignment, explicit template arguments and more in C++20, and even more possibilities are coming in the upcoming C++23 standard.

In this talk, we are looking at various interesting things you can do with lambdas. Some of these are well-established, useful idioms; others are lesser known, surprising tricks. Have you ever inherited from a lambda? Can you think of three different ways to call a lambda recursively? Do you know what happens if we assign an immediately-invoked lambda expression to a static variable? If not, then this talk is for you.
---

Timur Doumler

Timur Doumler is the Developer Advocate for C++ tools at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities, clean code, good tools, low latency, and the evolution of the C++ language.
__

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #lambda

Filed under: UncategorizedTagged with: , , , , , ,

Taking a Byte Out of C++ – Avoiding Punning by Starting Lifetimes – Robert Leahy – CppCon 2022

https://cppcon.org/
---

Taking a Byte Out of C++ - Avoiding Punning by Starting Lifetimes - Robert Leahy - CppCon 2022
https://github.com/CppCon/CppCon2022

Marshaling raw bytes into objects is a perennial problem in C++. Bytes may exist in memory, we may know they’re of the correct form to back a C++ object, but the abstract virtual machine says none of the desired objects exist at that location. The temptation to type pun and hope that happens to work, and continues to do so, runs strong.

What if we had start_lifetime_as? We could synthesize objects backed directly by bytes without superfluous calls to memcpy/memmove and prayers to the optimizer. What would that world look like? What sort of patterns could we use to work efficiently and correctly in that world?

This talk answers such questions against the backdrop of a database engine which makes use of this proposed functionality. Analysis will move from raw bytes, to C++ objects, to heterogeneous streams of such objects with discussion of the sharp edges at each level. End to end zero copy will be shown to be both possible and correct.
---

Robert Leahy

Robert is a graduate of the University of Victoria where he specialized in graphics, gaming, and digital geometry processing. After spending 4.5 years in full stack web development he pivoted to financial infrastructure in early 2016 and now works on next generation market data storage and retrieval mechanisms. In 2019 he became involved in the ISO C++ committee with a particular focus on library evolution.
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

#cppcon #programming #byte

Filed under: UncategorizedTagged with: , , , , , , ,

What’s New in C++23 – Sy Brand – CppCon 2022

https://cppcon.org/
---

What’s New in C++23 - Sy Brand - CppCon 2022
https://github.com/CppCon/CppCon2022

C++23 comes with a host of language and library features to simplify your code, make it more expressive, and give you more power to play with. With the help of my cats, I’ll walk you through the majority of upcoming features, showing you how they can work together and what benefits you’ll gain from upgrading when the time comes.
---

Sy Brand

Sy Brand is Microsoft’s C++ Developer Advocate. Their background is in compilers and debuggers for embedded accelerators, but they’re also interested in generic library design, metaprogramming, functional-style C++, undefined behaviour, and making our communities more welcoming and inclusive.
__

Videos Streamed, Edited, and YouTube Channel Managed by Digital Medium: http://online.digital-medium.co.uk

#cppcon #programming #coding

Filed under: UncategorizedTagged with: , , , , , ,