MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #16846 All Revisions ] Back to Issue ]
Summary 0016846: [OCCT Forum] Multithreading troubles: reference counter of Standard_Transient
Revision 2011-12-01 11:22 by szy
Additional information
and documentation updates
Documentation remark, added by ABV 2007-10-22 15:46:39:

New features:
New static functions IsReentrant() and SetReentrant() are added in Standard
package to query and set flag for reentrant (i.e. thread-safe) mode of
operation of TKernel services (memory manager, handles, exceptions).
Note that by default this mode is Off; it can be activated also by defining
environment variable MMGT_REENTRANT before starting OCCT.
Improvements:
Reference counter in Standard_Transient class (thus all OCCT classes managed by
handles) is protected to be thread-safe. Note that this protection is effective
only on Windows and Linux platforms by the moment, and is active only if
reentrant mode is set (see Standard::IsReentrant()).

Note that this improvement leads to some downgrade of performance of creation
and desctruction of Handle objects (by ~ 2 times when reentrant mode is OFF, ~ 10
times when it is ON), thus it becomes yet more important to avoid creation of
unnecessary Handles in performance-critical parts of the code. For information,
the time of creation and destruction of one Handle measured on P4 3GHz CPU is
around 20 ns in non-reentrant mode and 100 ns in reentrant mode.
Changes:
Some changes have been made in basic OCCT headers:

- Statement "using std;" in Standard_Stream.hxx has been replaced by individual
"using" statements for several types used extensively inside OCCT code. This
should reduce risk of conflicts between OCCT headers and application codes due
to imported STL names. On the other side, some code probably might need to be
corrected to add std:: prefix before STL classes (or equivalent using
statement).

- In Standard_Macro.hxx for WNT plaftform, a number of macros have been defined
(such as WIN32_LEAN_AND_MEAN) aimed to reduce scope of symbols defined by
eventual inclusion of windows.h. This is necessary to prevent interference
between multiple macro definitions made in windows.h (e.g. SendMessage #defined
as SendMessageA) and normal code of OCCT and applications. If some code needs
complete set of symbols defined in windows.h, this code may include windows.h
prior to OCCT headers.
Revision 2011-11-28 10:38 by abv
Additional information
and documentation updates
Documentation remark, added by Andrey BETENEV (abv) 2007-10-22 15:46:39:

New features:
New static functions IsReentrant() and SetReentrant() are added in Standard
package to query and set flag for reentrant (i.e. thread-safe) mode of
operation of TKernel services (memory manager, handles, exceptions).
Note that by default this mode is Off; it can be activated also by defining
environment variable MMGT_REENTRANT before starting OCCT.
Improvements:
Reference counter in Standard_Transient class (thus all OCCT classes managed by
handles) is protected to be thread-safe. Note that this protection is effective
only on Windows and Linux platforms by the moment, and is active only if
reentrant mode is set (see Standard::IsReentrant()).

Note that this improvement leads to some downgrade of performance of creation
and desctruction of Handle objects (by ~ 2 times when reentrant mode is OFF, ~ 10
times when it is ON), thus it becomes yet more important to avoid creation of
unnecessary Handles in performance-critical parts of the code. For information,
the time of creation and destruction of one Handle measured on P4 3GHz CPU is
around 20 ns in non-reentrant mode and 100 ns in reentrant mode.
Changes:
Some changes have been made in basic OCCT headers:

- Statement "using std;" in Standard_Stream.hxx has been replaced by individual
"using" statements for several types used extensively inside OCCT code. This
should reduce risk of conflicts between OCCT headers and application codes due
to imported STL names. On the other side, some code probably might need to be
corrected to add std:: prefix before STL classes (or equivalent using
statement).

- In Standard_Macro.hxx for WNT plaftform, a number of macros have been defined
(such as WIN32_LEAN_AND_MEAN) aimed to reduce scope of symbols defined by
eventual inclusion of windows.h. This is necessary to prevent interference
between multiple macro definitions made in windows.h (e.g. SendMessage #defined
as SendMessageA) and normal code of OCCT and applications. If some code needs
complete set of symbols defined in windows.h, this code may include windows.h
prior to OCCT headers.
Revision 2009-06-23 15:10 by abv
Additional information
and documentation updates
Documentation remark, added by Andrey BETENEV (abv) 2007-10-22 15:46:39:

New features:
New static functions IsReentrant() and SetReentrant() are added in Standard
package to query and set flag for reentrant (i.e. thread-safe) mode of
operation of TKernel services (memory manager, handles, exceptions).
Note that by default this mode is Off; it can be activated also by defining
environment variable MMGT_REENTRANT before starting OCCT.
Improvements:
Reference counter in Standard_Transient class (thus all OCCT classes managed by
handles) is protected to be thread-safe. Note that this protection is effective
only on Windows and Linux platforms by the moment, and is active only if
reentrant mode is set (see Standard::IsReentrant()).

Note that this improvement leads to some downgrade of performance of creation
and desctruction of Handle objects (by ~2 times when reentrant mode is OFF, ~10
times when it is ON), thus it becomes yet more important to avoid creation of
unnecessary Handles in performance-critical parts of the code. For information,
the time of creation and destruction of one Handle measured on P4 3GHz CPU is
around 20 ns in non-reentrant mode and 100 ns in reentrant mode.
Changes:
Some changes have been made in basic OCCT headers:

- Statement "using std;" in Standard_Stream.hxx has been replaced by individual
"using" statements for several types used extensively inside OCCT code. This
should reduce risk of conflicts between OCCT headers and application codes due
to imported STL names. On the other side, some code probably might need to be
corrected to add std:: prefix before STL classes (or equivalent using
statement).

- In Standard_Macro.hxx for WNT plaftform, a number of macros have been defined
(such as WIN32_LEAN_AND_MEAN) aimed to reduce scope of symbols defined by
eventual inclusion of windows.h. This is necessary to prevent interference
between multiple macro definitions made in windows.h (e.g. SendMessage #defined
as SendMessageA) and normal code of OCCT and applications. If some code needs
complete set of symbols defined in windows.h, this code may include windows.h
prior to OCCT headers.


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker