-
Notifications
You must be signed in to change notification settings - Fork 380
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
ace/Synch.h sanitizations #322
base: master
Are you sure you want to change the base?
Conversation
Conflicts: ACE/tests/Recursive_Condition_Bug_Test.cpp
ACE/protocols/ace/RMCast/RMCast.mpc
Outdated
dynamicflags += ACE_RMCAST_BUILD_DLL | ||
|
||
specific { | ||
install_dir = ace/RMCast | ||
} | ||
|
||
// *TODO*: this is essentially a workaround to be removed ASAP. On modern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have other compilers than msvc on windows, probably this has to be specific to the microsoft compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the MPC documentation for how to write a section that only applies to MSVC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Fixed in commit 199cd41
Can you check the systems from which you commit, one seems to use an invalid email address. |
Please check .gitignore, the changes don't make sense to me. The semantics of [] are "pick one character from the list." |
the changes to .gitignore reflect the fact that the rule |
ACE/TAO/rules.tao.GNU
Outdated
@@ -0,0 +1 @@ | |||
../../TAO/TAO_IDL/rules.tao.GNU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Removed in commit 7723fd6
I see that you add an include of ace/Synch.h to a lot of files, this means that you pull in all possible headers for synchronization which looks an overkill, a lot of time has been spend on making it possible to just include the wrappers needed, now you include everything again, resulting in more compile-time and potential footprint. Is there no other solution? |
A new set of meta-headers should be introduced to structurize the functionality (i.e. separate mutex/condition, process/thread scope, ...). In this scenario, Complementary next steps keep To me, some combination of these ideas will lead to a good intermediate solution. |
ACE implements abstractions for synchronization primitives, supporting platform features and emulating functionality that may not be available natively (e.g. recursive mutexes, absolute/relative timeouts, thread mutexes, (DLL-)singletons, etc). This abstraction is mostly implemented using macros in
ace/Synch_Traits.h
that translate into type declarations specifying the traits of 'strategized' class templates (e.g.ACE_Task_T
,ACE_GUARD
) as well as regular class members and variables (e.g.ACE_SYNCH_MUTEX
). I.e., rather than specifying a functionality by class, developers use a macro instead (e.g.ACE_SYNCH_MUTEX
forACE_Thread_Mutex
). [Notice also how ACE might start to integratestd::mutex
using (sets of) configuration macros such asACE_SYNCH_USE_STD_MUTEX
this way]These type declarations are sometimes templates themselves, leading to issues on some platforms, when the compiler cannot see their definitions at build time. This is being addressed by the meta-header
ace/Synch.h
, which#include
s all necessary declarations in the 'right' order. However, this approach introduces subtle issues (specifically, 'multiple definitions' linkage trouble for the template specializations, using MSVC).The proposed solution is two-fold:
ace/Synch.h
withace/Synch_Traits.h
in all ACE headers, and#include
ingace/Synch.h
in each translation unit (.cpp
) using any synchronization functionality at all (Note that this is a requirement, as compilers generally will not translate under-defined template classes). Note how this measure effectively moves the issue into each translation unit, where it can be solved individuallyextern template
s (introduced in C++11) whenever possibleThis way, the two-step approach (i.e. pre-processing + strategized primitives) towards abstracting synchronization described above becomes less error-prone and can be developed more easily.
This pull request addresses point one