Global variable global synchronization#451
Global variable global synchronization#451fbudin69500 wants to merge 1 commit intoInsightSoftwareConsortium:python-buildsfrom
Conversation
|
The problem on Windows could be the different conditions used on Windows, here: and here: Although the two patches introducing the conditions are pretty old (8 months and 10 months). It is surprising that this has not caused an issue so far if this is indeed the root of the problem. |
thewtex
left a comment
There was a problem hiding this comment.
Looking good!
A few inline comments.
Please rebase on master.
4ada86c to
d62c059
Compare
Replaces individual synchronization mechanisms across modules for each global variables used in ITK by a central mechanism in which all these variables are registered and which gives a single entry point to synchronize all global variables. Global variables are registered in a map, with a key that is their name and a value that is a pair of their pointer and a pointer to a synchronization function. The synchronization function will be called to synchronize these global variables across the different modules. Different global variables may have different synchronization functions: Some variables will just override the previous value in all modules whereas some others will need to actually synchronize their values. Several macros defined in `itkSingletonMacro.h` facilitate the usage of the new mechanism. A few static global variables have yet to be integrated to this mechanism. This included static variables defined in: * itkTransformFactoryBase.h * itkSpatialObjectFactoryBase.h * itkFEMFactoryBase.h * itkCurvatureNDAnisotropicDiffusionFunction.h * itkLevelSetFunction.h This list is not exhaustive and more global variables can be found with the following command line in bash: grep -r 'static '|grep m_ |grep -v ThirdParty |grep -v Review | grep -v const
d62c059 to
a66337e
Compare
|
On Windows, building ITK with MSVC++ 2017 with Python ON, and static libraries, the Python tests successfully pass. |
|
Are any additional tests needed? |
|
Not to my knowledge, although anybody who wants to test this patch locally is more than welcome to do so and report the results here. |
|
Merged in #118 |
Replaces individual synchronization mechanisms across modules for each global
variables used in ITK by a central mechanism in which all these variables
are registered and which gives a single entry point to synchronize
all global variables.
Global variables are registered in a map, with a key that is their name and
a value that is a pair of their pointer and a pointer to a synchronization
function. The synchronization function will be called to synchronize
these global variables across the different modules. Different global
variables may have different synchronization functions: Some variables
will just override the previous value in all modules whereas some
others will need to actually synchronize their values.
Change-Id: Ib6ebc9b3f9acd93ce8319f00579f6bf4982ca6b8