MantisBT - Community
View Issue Details
0022577Community[OCCT] OCCT:Visualizationpublic2011-06-06 20:272017-08-16 16:15
[OCCT] 6.5.2[OCCT] 6.5.2 
Test case is not required
0022577: Thread-safety/re-entrability improvements
RLN contribution (fix290)
- Summary: Thread-safety/re-entrability improvements
- Detailed description:
        AIS_InteractiveContext.cxx, AIS_GlobalStatus.cxx - avoid using static
1.GlobalStatus.cxx: Removed static variables (iterators)
2.InteractiveContext: a) Atomic increment replaces ++
                      b)removed static iterators
No tags attached.
related to 0028933feedback oan Open CASCADE Configuration - CMake generates OCCT project without SSE options for 32-bit Linux target 
child of 0022825closed abv Community Integration of contributions by Roman Lygin to OCCT 6.5.2 
Issue History
2011-07-05 18:11kgvCC => kgv
2011-07-20 21:25bugmasterStatusclosed => assigned
2011-07-20 21:25bugmasterResolutionsuspended => @0@
2011-07-20 21:25bugmasterAssigned Tobugmaster => kgv
2011-07-20 21:25bugmasterStatusassigned => resolved
2011-07-20 21:25bugmasterStatusresolved => tested
2011-07-20 21:26bugmasterStatustested => verified
2011-07-29 15:30bugmasterFixed in VersionEMPTY =>
2011-07-29 15:30bugmasterTarget Version => 6.5.2
2011-07-29 15:30bugmasterDescription Updatedbug_revision_view_page.php?rev_id=112#r112
2011-08-02 11:24bugmasterCategoryOCCT:VIZ => OCCT:Visualization
2011-09-07 17:23mkvTest case number => Test case is not required
2011-11-25 11:39szyDescription Updatedbug_revision_view_page.php?rev_id=1063#r1063
2011-11-25 11:40szyNote Edited: 0017618bug_revision_view_page.php?bugnote_id=17618#r1065
2011-12-05 11:23abvRelationship addedchild of 0022825
2012-01-17 18:36abvAssigned Tokgv => Roman Lygin
2012-03-29 17:26bugmasterChangeset attached => occt master e33e7e78
2017-08-16 16:15kgvRelationship addedrelated to 0028933

2011-06-10 19:02   
Bug branch http://svn/svn/occt/branches/OCC22577_AISThreadSafety [^] was reviewed.
- One file was committed with wrong end-lines.
- Replacement of unsafe incrementing with atomic operations is incomplete.
Static variable should be marked with volatile keyword and result of increment
operation should be retrieved within one operation. Current method
Standard_Atomic_Increment doesn't provide such interface and should be
extended with required functionality. Something like this:

    static int32_t Standard_Atomic_Increment(volatile int32_t* theValue) {
        // g++ compiler
        return __sync_add_and_fetch(theValue, 1);
    #elif (defined(_WIN32) || defined(__WIN32__))
        return InterlockedIncrement((volatile LONG* )theValue);
    #elif defined(__GNUC__)
        #error "Set at least -march=i486 for gcc compiler"
        return ++(*theValue);
        #error "Atomic operation doesn't implemented for current platform!"
        return ++(*theValue);

All remarks should be fixed and extra code review is required.
2011-06-22 14:14   
Standard_Atomic_* functions was improved to return operation result.
New syntax now used in Handle(Standard_Transient) and in
AIS_InteractiveContext thread-safety improvements.

Changes integrated to the BUG branch and ready for testing.
2011-07-20 14:50   
(edited on: 2011-11-25 11:40)
Dear BugMaster,
SVN branch ( http://svn/svn/occt/branches/OCC22577_AISThreadSafety [^] ) was
testing, test results were compared with KAS:dev:products-651-opt

Regressions were not found
It is not necessary to create test case for this issue

See results in /KASDev/OCCTtests/KAS/dev/ycy-products-2_08072011/lin
See reference results in
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions [^]

2011-07-20 21:26   
Integrated to occt repository

Author: inv
Date: 2011-07-20 19:21:54 +0400 (Wed, 20 Jul 2011)
New Revision: 8715