Dynamically Loaded Libraries Outside the Standard - Zhihao Yuan - CppCon 2021

preview_player
Показать описание
---
You must be aware of dynamically-link libraries, but have you tried using them through LoadLibrary on Windows or dlopen on UNIX?

A library may be dynamically-linked, but not designed for being loaded at runtime. Likewise, we may load a library at runtime, but we may not need to unload it before the program exits. In other words, a library can be "dynamic" at different levels. Those dynamically loaded and dynamically unloaded are often more special than the ones that do not. However, the dark side is that the more dynamic a library is, the further they are apart from the C++ standard.

This talk will cover a few typical use cases of dynamically loaded libraries, such as delay loading, plugin system, live update. We will discuss their status quo on different platforms, tools for diagnosis, common practices, problems, and what standardization can do to them. These should inspire you about what to do when designing your next architecture that may involve dynamically loaded code.

---
Zhihao Yuan

Zhihao Yuan is an R&D Software Engineer at Symantec, a division of Broadcom. He participated in standardizing designated initializers and improved narrowing conversions in C++20 but ends up almost exclusively programmed in Python last year and only recently picked up C++14 again. He finished watching the first Macross, a 1982 animation, early this year.

---

Рекомендации по теме
Комментарии
Автор

A very clear and systematic introduction to dynamic loading! Great talk!

XiyueDeng
Автор

There is a very good beginner introduction for hot-reloading libraries, ie reload dynamically loaded libraries, so that you can test things live, when the application is running, making changes to the library and see the change in behavior in the application without rebuilding the application binary.

There is a video on youtube about it called "handmade hero loading game code dynamically". It is related to this video and provide additional real world examples. Its really a pretty cool technique.

simonfarre
Автор

32:43 this does not look very effective performance-wise. I would introduce a cfg-file where plugins are listed.

qazarl