I use some 3rd party library, which consists of the library itself, let's say libmain.so and an optional plugin, libplugin.so, loaded at runtime. Both of them use asio.
libmain.so creates, owns and runs io_service instance and passes a reference to the plugin to initialize the timer.
Problem: when io_service and timer are created in different .so modules, the timer is not triggered. When they are created in the same module - everything works.
I did some investigation and it seems that the problem in boost::asio::detail::service_registry.
It uses address of a static filed 'id' to identify a type and to check for duplicates in the registry.
Addresses from different .so are different, so io_service listens (via select) for a wrong instance of internal timer service.
My question: usage of io_service and timers from different .so modules - is it a supported use case?
Platform: QNX Neutrino, boost asio: v. 1.61
I use some 3rd party library, which consists of the library itself, let's say libmain.so and an optional plugin, libplugin.so, loaded at runtime. Both of them use asio.
libmain.so creates, owns and runs io_service instance and passes a reference to the plugin to initialize the timer.
Problem: when io_service and timer are created in different .so modules, the timer is not triggered. When they are created in the same module - everything works.
I did some investigation and it seems that the problem in boost::asio::detail::service_registry. It uses address of a static filed 'id' to identify a type and to check for duplicates in the registry. Addresses from different .so are different, so io_service listens (via select) for a wrong instance of internal timer service.
My question: usage of io_service and timers from different .so modules - is it a supported use case? Platform: QNX Neutrino, boost asio: v. 1.61