MantisBT - Open CASCADE
View Issue Details
0032449Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2021-06-16 18:532021-07-23 10:16
asuraven 
bugmaster 
normalfeature 
closednot fixable 
 
[OCCT] 7.6.0* 
0032449: Modeling Algorithms - make curves adaptors classes thread safe
Adaptor3d_Curve, Adaptor2d_Curve2d and its child classes are not thread safe, but it is necessary for using GeomLib_CheckCurveOnSurface class for validity checking. As possible solution provide thread safety for them using separate cash for every thread.
No tags attached.
related to 0027491closed bugmaster Community Modeling Data - document thread-safety behavior of GeomAdaptor_Curve 
related to 0024682closed bugmaster Open CASCADE Move out B-spline cache from curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache 
related to 0032450verified bugmaster Open CASCADE Modeling Algorithms - change BRepLib_CheckCurveOnSurface & GeomLib_CheckCurveOnSurface interfaces to adaptors 
related to 0032485verified bugmaster Open CASCADE Modeling Algorithms - Add Clone() function for adapters 
Issue History
2021-06-16 18:53asuravenNew Issue
2021-06-16 18:53asuravenAssigned To => msv
2021-06-16 18:53asuravenNote Added: 0101877
2021-06-16 19:04asuravenRelationship addedrelated to 0032450
2021-06-16 19:15msvRelationship addedrelated to 0027491
2021-06-16 19:21msvNote Added: 0101878
2021-06-16 20:46kgvRelationship addedrelated to 0024682
2021-06-21 10:13szyNote Edited: 0101877bug_revision_view_page.php?bugnote_id=101877#r25396
2021-07-02 17:41szyAssigned Tomsv => asuraven
2021-07-02 17:42szyStatusnew => assigned
2021-07-06 20:49asuravenNote Added: 0102316
2021-07-08 17:11asuravenNote Added: 0102379
2021-07-13 17:25asuravenNote Added: 0102497
2021-07-15 15:04asuravenNote Added: 0102544
2021-07-15 16:46asuravenNote Added: 0102549
2021-07-16 14:41kgvNote Added: 0102577
2021-07-16 14:41kgvSeverityminor => feature
2021-07-16 18:30asuravenNote Added: 0102589
2021-07-19 12:43asuravenRelationship addedrelated to 0032485
2021-07-19 12:44asuravenNote Added: 0102633
2021-07-19 12:51asuravenNote Edited: 0102633bug_revision_view_page.php?bugnote_id=102633#r25510
2021-07-19 12:52asuravenNote Added: 0102637
2021-07-19 12:52asuravenAssigned Toasuraven => bugmaster
2021-07-19 12:52asuravenStatusassigned => feedback
2021-07-23 10:16szyNote Added: 0102736
2021-07-23 10:16szyStatusfeedback => closed
2021-07-23 10:16szyResolutionopen => not fixable

Notes
(0101877)
asuraven   
2021-06-16 18:53   
(edited on: 2021-06-21 10:13)


(0101878)
msv   
2021-06-16 19:21   
The classes in Adaptor3d and Adaptor2d are just interfaces. The real source of thread safety break is in the classes of packages Geom2dAdaptor and GeomAdaptor.

For generality, we need to improve not only curve adaptors, but also surface adaptor.

So, the classes to improve for thread safety are:

Geom2dAdaptor_Curve
GeomAdaptor_Curve
GeomAdaptor_Surface
(0102316)
asuraven   
2021-07-06 20:49   
(0102379)
asuraven   
2021-07-08 17:11   
(0102497)
asuraven   
2021-07-13 17:25   
(0102544)
asuraven   
2021-07-15 15:04   
(0102549)
asuraven   
2021-07-15 16:46   
(0102577)
kgv   
2021-07-16 14:41   
Making Adaptor classes thread-safe contradicts to their current design.
Previously, it has been discussed, that in case multi-threaded context, algorithm should create thread-local Adapator instance.

This could be achieved by using OSD_ThreadPool::Launcher with a functor accepting thread index for accessing thread-local variables within pre-allocated array of extent equal to (maximum) number of threads captured by OSD_ThreadPool::Launcher from Thread Pool at it's construction time.

It might be necessary extending Adaptor with Clone interface to be able to duplicate Adpator instances within specific algorithm.
(0102589)
asuraven   
2021-07-16 18:30   
(0102633)
asuraven   
2021-07-19 12:44   
(edited on: 2021-07-19 12:51)
After the analysis, it was decided not to add thread safety to adapters, but to ensure thread safety when using them. A new 32485 issue was created for provide multithread adaptors using.

(0102637)
asuraven   
2021-07-19 12:52   
 this task can be closed
(0102736)
szy   
2021-07-23 10:16   
A new 32485 issue was created to allow thread-safe usage of adaptors.