Comments (6)
I already talked with him verbally about this problem.
I think we should state that using the default_executor from a shared library is problematic and it is even more complicated when the user use our own thread pool implementation.
Keep this issue open, I will add something to the docs.
from libraries.
Just for the record: the issue has been resolved on our side (with the help of @FelixPetriconi) by copying over the await
implementation into that common compilation unit, and let it access the priority_task_system
instance via a separate function compiled into that unit.
from libraries.
The best answer here is to build your dynamic libraries with default visibility. Another option would be to provide an export list to the linker for all the stlab namespace symbols (--export-dynamic-symbol-list=<file>
if using ld
or lld
or a .def
file on Windows). You must ensure that all dynamic libraries are built with the same stlab version and configuration.
I'd consider a PR the used [[gnu::visibility("default")]]
in the required places - but if you go this route, please propose an example here so we can see how much it mucks with the code.
from libraries.
Thanks - yes, we are building all libraries with the same version and configuration.
About the visibility - would that really help in this case?
The problem here is that the implementation is all in header files (including the static allocation of the singleton), so there will be a separate instance created for each compilation unit. Would the linker be able to merge these, if using default visibilty? I've never used that, so I may have to read up on that first...
from libraries.
About the visibility - would that really help in this case?
Yes, linking with default visibility would fix it. All template instantiations are marked as "inline" to the linker so the linker will use the first instance it sees in all locations. If you are not linking with default visibility you are almost certainly causing (other) ODR violations as well.
from libraries.
Thank you, I will look into it!
from libraries.
Related Issues (20)
- Version in CMakeLists.txt is not correct
- Some files are missing in ./stlab/CMakeLists.txt HOT 1
- Build Error for Portable Executor for c++14 HOT 1
- Executor of packaged_task not used in reduction HOT 7
- Extra Copy of Object in Future Somewhere
- wasm main executor object not defined
- Upgrade to 1.7.1 now requires Qt and Boost HOT 20
- Is documentation generation broken? HOT 12
- No build output HOT 2
- Generated config.hpp Disables Ability to Use Same Source For Multiple Platforms HOT 1
- main_executor_type lost in main_executor.hpp for EMSCRIPTEN HOT 1
- Problem with main_executor for Qt on application exit HOT 3
- WASM main_executor improvements
- Broken compatibility with Qt5 HOT 1
- stlab documentation, best practice and performance HOT 3
- Express the type of `promise` HOT 3
- windows default executor is not exception safe.
- Add weak_future<>
- Update range based algorithms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libraries.