-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need correction for std::future (and probably std::shared_mutex) #17
Comments
The scope of this project initially was to provide just the basic platform-dependent primitives, on top of which the rest of the missing functionality could be implemented. Contribution of implementation of the remaining missing functionality is certainly welcome. |
We've used an ugly hack to enable the use of the stock std::future. |
I think you will be interested in https://gcc-mcf.lhmouse.com/. 😂 Rather than reinvent Introduction: https://github.com/lhmouse/mcfgthread/wiki |
@lhmouse I'm all for fixing this stuff at the
In facts, I was thinking of completing the gthr-win32 stuff with what is missing (essentially, thread creation/join/detach and condition variables). It would be nice to finally have the choice between mcfgthread (bleeding edge, for new systems) and a complete classic win32 thread model (slower, but with a simpler and more compatible implementation). I'm particularly obsessed by the idea of having a "simple", reliable gthread layer, as the "posix" (=winpthread) threading model aimed to something similar, but unfortunately is complex, messy code, is subtly broken (we found race conditions in thread creation/join/detach, with threads ending up having their associated support structure completely mixed up), with no clear way to salvage it. The fact that the bug linked above went completely ignored is also a strong indicator that winpthreads is essentially abandoned. |
Well then you might have few other options. You have to either implement condition variables yourself (it is hard to implement correctly, we know) or use the native one since Vista.
You can do that. GCC's gthr.h has documented what is needed well.
Thank you.
I can't agree with you more. There are more issues with winpthreads. The fact that the bug is ignored might be due to the requirement of specialized knowledge. People can't fix it without enough knowledge, which is not practical either because those people have been busy with their work, life, etc. Hence the goal of mcfgthread is to be as tiny as possible. There is little unnecessary code. A few important implementation details are documented on its Wiki pages. |
With
|
Currently, std::future class doesn’t work as all of its implementation is hidden under
_GLIBCXX_HAS_GTHREADS
macro. g++ generates error: invalid use of incomplete type 'class std::future'The text was updated successfully, but these errors were encountered: