View Issue Details

IDProjectCategoryView StatusLast Update
0029935Open CASCADEOCCT:Foundation Classespublic2019-08-28 10:06
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.4.0Fixed in Version7.4.0 
Summary0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool
DescriptionIt is desired to provide a Thread Pool class having the following properties:
- Thread pool allocates specific number of threads and keeps them alive (in sleep state when inactive) until destruction.
- Thread pool defines a predefined number of threads having unique indices within continuous range. This would allow algorithms allocating thread-local variables in a straight-forward way (by allocating an array of variables per thread). This may include resources like shared file handles.
- Thread pool can be re-used by the same thread within nested algorithms, limiting overall number of threads to be used.
- Thread pool can be shared across thread in thread-safe way.
- Default thread pool to be used by algorithms.
- Working threads catch exceptions and redirect them to launcher thread as Standard_Failure.

This interface will be also applicable to parallelization task implying blocking APIs (like reading files).

Note that this Thread Pool implementation would NOT be based on TBB library even when it is enabled. The reason, is that TBB does not specify similar API.

It is considered that OSD_Parallel::forEach() will use new class to avoid spawning unlimited number of threads.
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0026365 closedbugmaster Open CASCADE Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface 
related to 0028199 assigneddpasukhi Open CASCADE Foundation Classes - Add possibility to set number of threads for parallel execution 
related to 0025896 closedabv Community Modeling Algorithms - UserBreak raising uncatchable exception in boolean operations 
related to 0026329 closedkgv Open CASCADE Restore floating point signals handling in DRAW 
related to 0024589 closedbugmaster Open CASCADE Draw Harness - disable floating-point exceptions by default 
parent of 0029960 closedbugmaster Open CASCADE Foundation Classes - disarm OSD_ThreadPool copy constructor 
parent of 0030924 closedapn Open CASCADE Coding - incorrect header in file OSD_ThreadPool.hxx 
related to 0022146 closedabv Open CASCADE Foundation Classes - Integration of OCC in-house parallelization tool 
related to 0030573 closedapn Open CASCADE OSD_Parallel_TBB: limit number of execution threads using settings of OSD_ThreadPool::DefaultPool() 
related to 0030618 closedapn Open CASCADE Modeling Algorithms, BOPTools_Parallel - avoid using map for thread-local contexts without TBB 
related to 0030842 closeddenix56 Community C++11 support 

Activities

git

2018-07-07 02:30

administrator   ~0077317

Branch CR29935 has been created by kgv.

SHA-1: 0c64254517b9ec4b47a7b3bdb7805c7e44c55a01


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 02:27:51 2018 +0300

    0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool
    
    New class OSD_ThreadPool has been introduced defining a Thread Pool for multi-threading algorithm.
    Thread Pool assigns an serial number for each thread allowing Multi-Threading algorithm
    to allocate thread-local storage variables as an array having size of number of thread.
    
    New class Standard_Condition has been introduced providing platform-independent
    interface implementing a tool similar to Event in WinAPI.
    
    A new auxiliary function Standard_Atomic_CompareAndSwap() has been introduced
    for performing atomic compare and swap of integer number.
    Standard_Atomic_Increment/Standard_Atomic_Decrement fallback implementation
    using ASM code for x86 processors for GCC has been dropped;
    instead, it is expected that GCC should be properly configured targeting modern x86 architectures.

git

2018-07-07 03:00

administrator   ~0077319

Branch CR29935 has been updated forcibly by kgv.

SHA-1: da9b7c823f47984155d67cac0de8d64eac994437

git

2018-07-07 03:34

administrator   ~0077321

Branch CR29935 has been updated forcibly by kgv.

SHA-1: 316440312639d1aa0b8d083ad87776cbd3416589

git

2018-07-07 03:37

administrator   ~0077322

Branch CR29935 has been updated forcibly by kgv.

SHA-1: cb75801a319d6774f19ade85d692761907b5d6e0

git

2018-07-07 03:38

administrator   ~0077323

Branch CR29935 has been updated forcibly by kgv.

SHA-1: 95440a810ea306d84a27e066d3e384abca390210

kgv

2018-07-07 04:11

developer   ~0077326

Last edited: 2018-07-07 17:40

First draft is ready for review.

http://jenkins-test-11.nnov.opencascade.com/view/CR29935-CR29935-KGV

git

2018-07-07 09:24

administrator   ~0077327

Branch CR29935 has been updated forcibly by kgv.

SHA-1: 1427e9a94640c11e79e26e092950c72696ab2c1a

git

2018-07-07 18:52

administrator   ~0077329

Branch CR29935 has been updated by kgv.

SHA-1: 9031d6726d553f9a65c89fc78fa878da7d7efcd2


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 18:51:17 2018 +0300

    OSD_ThreadPool - redirect exceptions to a thread calling parallel execution

git

2018-07-07 23:23

administrator   ~0077334

Branch CR29935 has been updated forcibly by kgv.

SHA-1: d5d0f41e5c23d9d5b60989524132f6cd5db70197

git

2018-07-07 23:27

administrator   ~0077335

Branch CR29935 has been updated by kgv.

SHA-1: f453cbd76f0099a91a57f99f6d7476613ccafee0


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 23:26:45 2018 +0300

    OSD_Signal - declare fFltExceptions as thread_local

git

2018-07-07 23:47

administrator   ~0077336

Branch CR29935 has been updated by kgv.

SHA-1: 719feabd8f792711d7dd91927f8d9d8f46236ce6


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 23:47:04 2018 +0300

    # Rename OSD_ThreadPool::Sentry to OSD_ThreadPool::Launcher

git

2018-07-08 00:02

administrator   ~0077338

Branch CR29935_1 has been created by kgv.

SHA-1: 7fee3c347b13b89262d8559be91e11cdf43f63ba


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 02:27:51 2018 +0300

    0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool
    
    New class OSD_ThreadPool has been introduced defining a Thread Pool for multi-threading algorithm.
    Thread Pool assigns a serial number for each thread allowing Multi-Threading algorithm
    to allocate thread-local storage variables as an array having size of number of thread.
    OSD_ThreadPool also redirect exceptions to a thread calling parallel execution and initializes FPE exception handling in consistently.
    
    New class Standard_Condition has been introduced providing platform-independent
    interface implementing a tool similar to Event in WinAPI.
    
    A new auxiliary function Standard_Atomic_CompareAndSwap() has been introduced
    for performing atomic compare and swap of integer number.
    Standard_Atomic_Increment/Standard_Atomic_Decrement fallback implementation
    using ASM code for x86 processors for GCC has been dropped;
    instead, it is expected that GCC should be properly configured targeting modern x86 architectures.
    
    OSD_Signal now declares fFltExceptions as thread_local variable accessible through OSD::ToCatchFloatingSignals() property.
    Standard_THREADLOCAL macros (wrapping thread_local attribute) has been moved to public header Standard_Macro.hxx.

git

2018-07-08 00:13

administrator   ~0077340

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: 167c5bc729475801aaa225bf95c73c1593838a20

git

2018-07-08 11:00

administrator   ~0077341

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: a131c0cbe06a97b62aeaac3eccab0377ca1b95f3

git

2018-07-08 11:03

administrator   ~0077342

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: e52f9cfce2f3470f835051588b857c8e3d6f44f1

git

2018-07-08 14:05

administrator   ~0077376

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: 5c82965c89022a503f2fcb3ac02ebbf4f328d1f5

git

2018-07-08 19:39

administrator   ~0077378

Branch CR29935_1 has been updated by kgv.

SHA-1: 015bded33b6cda8dc5a9d9fe6c919fbce9eb0372


Detailed log of new commits:

Author: kgv
Date: Sun Jul 8 19:38:29 2018 +0300

    # OSD_ThreadPool remarks

git

2018-07-08 20:28

administrator   ~0077380

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: 44bfd9cac01b6f64254e1c121c7304e7e04e472e

git

2018-07-09 10:50

administrator   ~0077386

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: 6d996d685e05324a0b043bb4ed18e312e4acaa86

git

2018-07-09 17:48

administrator   ~0077395

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: 1a364ff12733c32c8fd416d0e81dbb5198ef9f1c

msv

2018-07-09 20:35

developer   ~0077397

Please avoid too long lines (max 120 chars according to coding rules, but I prefer 100) in the files:
src/OSD/OSD_ThreadPool.cxx
src/OSD/OSD_ThreadPool.hxx

src/OSD/OSD_ThreadPool.hxx
- The comments refer to not existent method NbDefaultThreads().

msv

2018-07-09 20:45

developer   ~0077398

According to current implementation, the current thread is not participated in running the job. It is not good, especially when the current thread belongs to the pool. It is better to allow it running the job and by default initialize the pool with (NbLogicalProcessors-1) threads.

git

2018-07-09 20:51

administrator   ~0077399

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: d6c35d187baaa8e871436861c4815de0d4518383

git

2018-07-09 22:22

administrator   ~0077400

Branch CR29935_1 has been updated by kgv.

SHA-1: 9695ead85795da77c35414a191c783a2b59572a8


Detailed log of new commits:

Author: kgv
Date: Mon Jul 9 22:21:59 2018 +0300

    # OSD_ThreadPool::Launcher now calls one job on self-thread

git

2018-07-10 01:53

administrator   ~0077401

Branch CR29935_1 has been updated by kgv.

SHA-1: d389a96add45aae7edeb2bdbbfdade066f6c1197


Detailed log of new commits:

Author: kgv
Date: Tue Jul 10 01:45:46 2018 +0300

    # extend test command OCC24826 and add OCC29935 computing product of two square matrices

kgv

2018-07-10 01:54

developer   ~0077402

Remarks has been considered.

git

2018-07-10 02:03

administrator   ~0077403

Branch CR29935_1 has been updated forcibly by kgv.

SHA-1: d080f635dcb5c28e895510ae946824b9076ff5b6

git

2018-07-10 03:05

administrator   ~0077405

Branch CR29935_1 has been updated by kgv.

SHA-1: 0d45955fbf231a37a9818a3057b8f7fdfe1e04d8


Detailed log of new commits:

Author: kgv
Date: Tue Jul 10 03:04:57 2018 +0300

    # fix incorrect size

git

2018-07-10 03:07

administrator   ~0077406

Branch CR29935_2 has been created by kgv.

SHA-1: d5185e879b6302bae926211eda683c1d4d5dfa23


Detailed log of new commits:

Author: kgv
Date: Sat Jul 7 02:27:51 2018 +0300

    0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool
    
    New class OSD_ThreadPool has been introduced defining a Thread Pool for multi-threading algorithm.
    Thread Pool assigns a serial number for each thread allowing Multi-Threading algorithm
    to allocate thread-local storage variables as an array having size of number of thread.
    OSD_ThreadPool also redirect exceptions to a thread calling parallel execution and initializes FPE exception handling consistently.
    
    New class Standard_Condition has been introduced providing platform-independent
    interface implementing a tool similar to Event in WinAPI.
    
    A new auxiliary function Standard_Atomic_CompareAndSwap() has been introduced
    for performing atomic compare and swap of integer number.
    Standard_Atomic_Increment/Standard_Atomic_Decrement fallback implementation
    using ASM code for x86 processors for GCC has been dropped;
    instead, it is expected that GCC should be properly configured targeting modern x86 architectures.
    
    OSD_Signal now declares fFltExceptions as thread_local variable accessible through OSD::ToCatchFloatingSignals() property.
    Standard_THREADLOCAL macro (wrapping thread_local attribute) has been moved to public header Standard_Macro.hxx.

msv

2018-07-10 10:30

developer   ~0077407

Last edited: 2018-07-10 11:08

//! Normally, single Launcher instance will occupy all threads available in thread pool,
//! so that nested multi-threaded algorithms (within the same thread)
//! and concurrent threads trying to use the same thread pool will run sequentially.
//! This behavior is affected by OSD_ThreadPool::NbDefaultThreadsToLaunch() parameter
//! and Launcher constructor, so that single Launcher instance will occupy not all threads
//! in the pool allowing other threads to be used concurrently.

Reading this comment I came to conclusion that in this implementation there is a disadvantage that not all threads in the pool can be utilized. E.g., main thread loaded the pool with some job having unbalanced tasks. Some task has run a nested job. On the moment of launching the nested job all threads in the pool are busy, and the nested job will be run in one current thread only. When all tasks in the main job are done the pool will have many threads idle. At the same time, the nested job will be performed still in one thread only.

It is needed to organize a queue of tasks. The tasks in the queue may come from different jobs. The threads in the pool must not be idle while the queue is not empty.

msv

2018-07-10 10:34

developer   ~0077408

Minor remark:
The methods OSD_ThreadPool::HasThreads, LowerThreadIndex, UpperThreadIndex, IsInUse and Launcher::HasThreads, NbThreads, LowerThreadIndex, UpperThreadIndex are nowhere used. Can they be helpful in some application? If no, it is better to remove them.

kgv

2018-07-10 10:55

developer   ~0077409

> Reading this comment I came to conclusion
This is known limitation of current implementation.

msv

2018-07-10 11:11

developer   ~0077410

By the way, I think the method OSD_ThreadPool::UpperThreadIndex contains a mistake - it returns the value larger by one of the actual index of the last thread.

kgv

2018-07-10 11:23

developer   ~0077411

Last edited: 2018-07-10 11:26

> By the way, I think the method OSD_ThreadPool::UpperThreadIndex
> contains a mistake - it returns the value larger by one
> of the actual index of the last thread.
It is intended behavior - it returns also an index of self thread:
+  //! Return the upper thread index (last index is reserved for self-thread).
+  int UpperThreadIndex() const { return LowerThreadIndex() + myThreads.Size() + 1; }


The purpose for LowerThreadIndex()/UpperThreadIndex() is to allow algorithm to know in advance the thread indexes range to be passed to Job (e.g. to allocate an array with per-thread objects), and since Self-thread should be also enumerated (it is appended to the end by Launcher) - it should be also returned.

+1 is added after considering remark that thread pool should run one job within launcher thread, so that the math became less straight-forward.

git

2018-07-10 11:51

administrator   ~0077412

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: cfdedbf3491141429de082fb8c12df383375a2eb

kgv

2018-07-10 11:52

developer   ~0077413

> By the way, I think the method OSD_ThreadPool::UpperThreadIndex
> contains a mistake - it returns the value larger by one
> of the actual index of the last thread.
Fixed, after clarification.

git

2018-07-11 18:23

administrator   ~0077469

Branch CR29935_2 has been updated by kgv.

SHA-1: 11b7f2c582e752c7f6d1430a96d38708e3ab983e


Detailed log of new commits:

Author: kgv
Date: Wed Jul 11 18:22:51 2018 +0300

    # remark: OSD_ThreadPool::Launcher::wait() now aggregates all thrown exceptions

git

2018-07-11 19:46

administrator   ~0077471

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: 6404afcf7aa47a5e423c5c347a6f025e0e12d24e

agv

2018-07-11 19:47

developer   ~0077472

Remark on Exception management:

When an exception occurs, the current thread stops executing the job and goes to Idle state, while other threads continue to execute in the regular way. This idles the CPU cores during the processing, and also may cause the Job be not processed till the end because every active thread encountered an exception. The method Launcher::wait() re-raises the exception at the lower thread index and ignores all other exceptions.

This leads to unpredictable / nonreproducible result, and I'd suggest to improve in one of the alternative ways:

1) The simplest. As soon as an exception is caught, cancel the whole execution in the Launcher by setting the flag myPool->myShutDown in performThread(). This exception is thrown from Launcher::Perform() and indicates that the whole Job is rotten.

2) More complex, meaning that nothing is terminated by an exception. For that:

 a) In performThread() the execution can be wrapped in a loop:

  while (myJob != NULL) {
    Handle(Standard_Failure) aFailure;
    OSD_ThreadPool::performJob (aFailure, myJob, myThreadIndex);
    if (aFailure.IsNull()
      myJob = NULL;
    else
      myFailure.Append(aFailure);
  }

 b) EnumeratedThread::myFailure becomes a list, or (better) it is a new type like Standard_MultiFailure : a list with each member containing the type and the string of exception (2 ASCII strings).

 c) Probably the best practice would be to restart the thread where an exception was caught: this means that performThread() terminates on an exception and OSD_ThreadPool recognizes that to restart the thread at a given index.

kgv

2018-07-11 20:01

developer   ~0077473

Last edited: 2018-07-11 20:03

> Remark on Exception management:
I believe, that if algorithm is expected to survive / handle exception, it should handle them within its Functor. Therefore, the main purpose of exception redirection within OSD_ThreadPool is to protected application from crash (when possible) and allow upper algorithm (at application level, handling any exceptions) to survive when multi-threaded algorithm misbehave (either, code called within Functor should never throw exception or should catch them internally). In this context, waiting other threads to complete tasks if only one thread has cot exception is not nice, but should happen only in broken cases and hence, not critical.

Therefore, I don't see a reason for complicating this handling logic within OSD_ThreadPool. This can be considered/improved by further patches, if found reasonable in future.

Meanwhile, I've corrected a patch to aggregate description of multiple exception cot by several threads.

agv

2018-07-11 20:12

developer   ~0077476

Remark on Priority management:

//! Normally, single Launcher instance will occupy all threads available in thread pool,
//! so that nested multi-threaded algorithms (within the same thread)
//! and concurrent threads trying to use the same thread pool will run sequentially.
//! This behavior is affected by OSD_ThreadPool::NbDefaultThreadsToLaunch() parameter
//! and Launcher constructor, so that single Launcher instance will occupy not all threads
//! in the pool allowing other threads to be used concurrently.

This is not the ultimate solution since it hardly can be possible for a developer to calculate the exact number of nested threads required in a concurrent processing. I'd propose to avoid any limitation on threads and instead to manage them by Priority. This also has reasons in common cases:

1) The main (GUI) thread runs an OSD_Parallel where some heavy processing takes place. If the worker threads are created with Normal priority then they may slow down the GUI and even hang the application for many seconds. On the other hand, if the worker threads use "Below Normal" priority then the GUI will not be affected, regardless of the number of worker threads.

2) When a worker thread runs its own OSD_Parallel then the nested threads should be executed with a greater priority (Above Normal) to make sure that the parent worker thread is released as soon as possible.

To manage thread priorities it will be necessary to:

a) In OSD_Thread -- use myPriority in pthread_create() call, via "pthread_attr_t" structure. In WIN32 branch myPriority is already taken into account.

b) In OSD_ThreadPool add the priority value to the constructor or add a method SetPriority(), to use this value when the threads are created.

c) OSD_ThreadPool::myNbDefThreads becomes obsolete, NbThreads() will be used to the full extent of the Pool.

With this scheme every nested parallel algorithm would simply allocate its private OSD_ThreadPool with any number of threads (like number of CPU cores).

agv

2018-07-11 20:23

developer   ~0077477

>> Remark on Exception management:
>In this context, waiting other threads to complete tasks if only one thread has cot exception is not nice, but should happen only in broken cases and hence, not critical.

You don't consider the case when a Functor thinks that the Job is incorrect and should not be processed anymore. This is not unusual and can be part of the normal processing routine. With my proposal it can just throw a Standard_ProgramError and the whole global processing would stop almost immediately.

In the current architecture there is no way to send a signal for termination from Functor to Launcher, or I missed something in it?

kgv

2018-07-11 20:31

developer   ~0077478

> With this scheme every nested parallel algorithm
> would simply allocate its private OSD_ThreadPool
> with any number of threads (like number of CPU cores).
If I understood this suggestions correctly, it is irrelevant to the current patch (introduction of OSD_ThreadPool class; its usage in OSD_Parallel::For is just a side effect) and completely contradicts to its purpose - to avoid spawning uncontrollable amount of threads in application (from performance point of view, but also from memory usage point of view). Libraries lacking thread pool management logic and creating a new pool locally within algorithm suffer from such implicit badly controllable parallelization, till application crash.

> To manage thread priorities it will be necessary to:
Thread priorities is a dark matter, which should be handled carefully.
I propose this should be done in dedicated patch, if needed.

kgv

2018-07-11 20:36

developer   ~0077479

Last edited: 2018-07-11 20:37

> In the current architecture there is no way to send a signal
> for termination from Functor to Launcher, or I missed something in it?
Functor is not supposed to control Launcher.
If Functor needs to abort all parallel jobs of a common algorithm, for some reason (e.g. user breaks operation),
it should handle it using own logic / own Boolean flag like Message_ProgressSentry::More() (by doing nothing or throwing exception in all jobs).

git

2018-07-12 12:11

administrator   ~0077506

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: c9f1cdc4c89ab98a9b0b864baa7415c803a1c3c0

git

2018-07-12 12:14

administrator   ~0077507

Branch CR29935_old_no_tbb has been created by kgv.

SHA-1: 11088370341b01e091720e5c3b288d07fa0dc4e9


Detailed log of new commits:

Author: kgv
Date: Thu Jul 12 12:13:42 2018 +0300

    0029935: test disabled TBB

git

2018-07-12 12:15

administrator   ~0077508

Branch CR29935_2_test_no_tbb has been created by kgv.

SHA-1: aad20bfc985de88e1c0cb6de1221582f193a83cf


Detailed log of new commits:

Author: kgv
Date: Thu Jul 12 12:14:29 2018 +0300

    Test disabled TBB

git

2018-07-12 12:45

administrator   ~0077515

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: b2d954b1ac6faa34b288e0a049d5071e28057bc4

git

2018-07-12 14:23

administrator   ~0077520

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: a82378e904cfd644c8163d42a26d081284a840ff

git

2018-07-12 14:24

administrator   ~0077521

Branch CR29935_2 has been updated by kgv.

SHA-1: cb4022e01e1e371feb68360125d1c11b4a67ecfa


Detailed log of new commits:

Author: kgv
Date: Thu Jul 12 14:23:31 2018 +0300

    OSD_Parallel::ForEach() has been extended with new optional parameter theNbItems.

git

2018-07-12 14:25

administrator   ~0077522

Branch CR29935_2_test_no_tbb has been updated forcibly by kgv.

SHA-1: 9e2002c199089cd6d95c3fb1b55159828edab0b4

kgv

2018-07-12 14:28

developer   ~0077523

Last edited: 2018-07-12 16:22

Test cases using brunparallel on 4 CPUs core (TBB disabled).

Draw[1]> testgrid perf modalg bug25788 -parallel 0
OLD: Elapsed time: 0 Hours 0 Minutes 5.17670856009 Seconds
NEW: Elapsed time: 0 Hours 0 Minutes 5.17724189372 Seconds
TBB: Elapsed time: 0 Hours 0 Minutes 5.22508987039 Seconds

Draw[1]> testgrid bugs modalg_7 bug27760,bug27936,bug28157,bug28485,bug28485_1,bug29182,bug29182_1 -parallel 0
OLD: Elapsed time: 0 Hours 0 Minutes 16.4535191598 Seconds
NEW: Elapsed time: 0 Hours 0 Minutes 15.8446485167 Seconds
TBB: Elapsed time: 0 Hours 0 Minutes 15.808022778 Seconds

msv

2018-07-12 15:06

developer   ~0077528

Reviewed.

git

2018-07-12 16:17

administrator   ~0077534

Branch CR29935_2 has been updated forcibly by kgv.

SHA-1: 76d9bcb27997359b9f829bfada668f986ef3b218

bugmaster

2018-07-12 18:17

administrator   ~0077549

Combination -
OCCT branch : CR29935_2 SHA - d5185e879b6302bae926211eda683c1d4d5dfa23
Products branch : CR29935_1 SHA - b480cde001d5002877e7b85cbd8ae2ce3f0048e5
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 0 / 0
Products
Total CPU difference: 0 / 0
Windows-64-VC10:
OCCT
Total CPU difference: 16865.970114498592 / 16852.39802749857 [+0.08%]
Products
Total CPU difference: 8245.370454599857 / 8212.11104139987 [+0.41%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2018-07-14 12:41

administrator   ~0077601

Branch CR29935_2 has been deleted by inv.

SHA-1: 76d9bcb27997359b9f829bfada668f986ef3b218

git

2018-07-14 12:41

administrator   ~0077602

Branch CR29935_2_test_no_tbb has been deleted by inv.

SHA-1: 9e2002c199089cd6d95c3fb1b55159828edab0b4

git

2018-07-14 12:41

administrator   ~0077606

Branch CR29935_old_no_tbb has been deleted by inv.

SHA-1: 11088370341b01e091720e5c3b288d07fa0dc4e9

git

2018-07-14 12:42

administrator   ~0077615

Branch CR29935_1 has been deleted by inv.

SHA-1: 0d45955fbf231a37a9818a3057b8f7fdfe1e04d8

git

2018-07-14 12:42

administrator   ~0077618

Branch CR29935 has been deleted by inv.

SHA-1: 719feabd8f792711d7dd91927f8d9d8f46236ce6

Related Changesets

occt: master 6f498847

2018-07-06 23:27:51

kgv


Committer: bugmaster Details Diff
0029935: Foundation Classes - introduce OSD_ThreadPool class defining a thread pool

New class OSD_ThreadPool has been introduced to define a Thread Pool for multi-threading algorithm.
Thread Pool assigns a serial number for each thread allowing Multi-Threading algorithm to allocate thread-local storage variables as an array whose size is the same as the number of threads.

OSD_ThreadPool also redirects exceptions to a thread calling parallel execution and consistently initializes FPE exception handling.

New class Standard_Condition provides a platform-independent tool similar to Event in WinAPI.

A new auxiliary function Standard_Atomic_CompareAndSwap() has been introduced
for performing atomic compare and swap of integer number.
Standard_Atomic_Increment/Standard_Atomic_Decrement fallback implementation
using ASM code for x86 processors for GCC has been dropped;
instead, it is expected that GCC should be properly configured targeting modern x86 architectures.

OSD_Signal now declares fFltExceptions as thread_local variable accessible through OSD::ToCatchFloatingSignals() property.
Standard_THREADLOCAL macro (wrapping thread_local attribute) has been moved to public header Standard_Macro.hxx.

OSD_Parallel::ForEach() has been extended with new optional parameter theNbItems and uses OSD_ThreadPool::DefaultPool().
Affected Issues
0029935
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
mod - src/BRepMesh/BRepMesh_IncrementalMesh.cxx Diff File
mod - src/OSD/FILES Diff File
mod - src/OSD/OSD.hxx Diff File
mod - src/OSD/OSD_Parallel.hxx Diff File
mod - src/OSD/OSD_Parallel_TBB.cxx Diff File
mod - src/OSD/OSD_Parallel_Threads.cxx Diff File
mod - src/OSD/OSD_signal.cxx Diff File
add - src/OSD/OSD_ThreadPool.cxx Diff File
add - src/OSD/OSD_ThreadPool.hxx Diff File
mod - src/QABugs/QABugs_19.cxx Diff File
mod - src/Standard/FILES Diff File
mod - src/Standard/Standard_Atomic.hxx Diff File
add - src/Standard/Standard_Condition.cxx Diff File
add - src/Standard/Standard_Condition.hxx Diff File
mod - src/Standard/Standard_Failure.cxx Diff File
mod - src/Standard/Standard_Macro.hxx Diff File

Issue History

Date Modified Username Field Change
2018-07-07 02:18 kgv New Issue
2018-07-07 02:18 kgv Assigned To => abv
2018-07-07 02:30 git Note Added: 0077317
2018-07-07 02:32 kgv Relationship added related to 0026365
2018-07-07 02:32 kgv Relationship added related to 0028199
2018-07-07 02:34 kgv Relationship added related to 0022146
2018-07-07 03:00 git Note Added: 0077319
2018-07-07 03:34 git Note Added: 0077321
2018-07-07 03:37 git Note Added: 0077322
2018-07-07 03:38 git Note Added: 0077323
2018-07-07 04:11 kgv Note Added: 0077326
2018-07-07 04:11 kgv Status new => resolved
2018-07-07 09:24 git Note Added: 0077327
2018-07-07 17:40 kgv Note Edited: 0077326
2018-07-07 18:52 git Note Added: 0077329
2018-07-07 23:09 abv Relationship added related to 0025896
2018-07-07 23:23 git Note Added: 0077334
2018-07-07 23:27 git Note Added: 0077335
2018-07-07 23:47 git Note Added: 0077336
2018-07-08 00:02 git Note Added: 0077338
2018-07-08 00:13 git Note Added: 0077340
2018-07-08 00:23 kgv Description Updated
2018-07-08 11:00 git Note Added: 0077341
2018-07-08 11:03 git Note Added: 0077342
2018-07-08 14:05 git Note Added: 0077376
2018-07-08 19:39 git Note Added: 0077378
2018-07-08 20:28 git Note Added: 0077380
2018-07-09 10:50 git Note Added: 0077386
2018-07-09 15:42 kgv Assigned To abv => msv
2018-07-09 17:48 git Note Added: 0077395
2018-07-09 20:35 msv Note Added: 0077397
2018-07-09 20:45 msv Note Added: 0077398
2018-07-09 20:46 msv Assigned To msv => agv
2018-07-09 20:51 git Note Added: 0077399
2018-07-09 22:22 git Note Added: 0077400
2018-07-10 01:53 git Note Added: 0077401
2018-07-10 01:54 kgv Note Added: 0077402
2018-07-10 01:54 kgv Assigned To agv => msv
2018-07-10 02:03 git Note Added: 0077403
2018-07-10 03:05 git Note Added: 0077405
2018-07-10 03:07 git Note Added: 0077406
2018-07-10 10:30 msv Note Added: 0077407
2018-07-10 10:34 msv Note Added: 0077408
2018-07-10 10:55 kgv Note Added: 0077409
2018-07-10 11:08 msv Note Edited: 0077407
2018-07-10 11:11 msv Note Added: 0077410
2018-07-10 11:23 kgv Note Added: 0077411
2018-07-10 11:25 kgv Note Edited: 0077411
2018-07-10 11:26 kgv Note Edited: 0077411
2018-07-10 11:51 git Note Added: 0077412
2018-07-10 11:52 kgv Note Added: 0077413
2018-07-10 11:56 msv Assigned To msv => kgv
2018-07-10 11:56 msv Assigned To kgv => agv
2018-07-11 18:23 git Note Added: 0077469
2018-07-11 19:46 git Note Added: 0077471
2018-07-11 19:47 agv Note Added: 0077472
2018-07-11 20:01 kgv Note Added: 0077473
2018-07-11 20:02 kgv Note Edited: 0077473
2018-07-11 20:03 kgv Note Edited: 0077473
2018-07-11 20:12 agv Note Added: 0077476
2018-07-11 20:23 agv Note Added: 0077477
2018-07-11 20:31 kgv Note Added: 0077478
2018-07-11 20:36 kgv Note Added: 0077479
2018-07-11 20:37 kgv Note Edited: 0077479
2018-07-12 12:11 git Note Added: 0077506
2018-07-12 12:14 git Note Added: 0077507
2018-07-12 12:15 git Note Added: 0077508
2018-07-12 12:45 git Note Added: 0077515
2018-07-12 14:23 git Note Added: 0077520
2018-07-12 14:24 git Note Added: 0077521
2018-07-12 14:25 git Note Added: 0077522
2018-07-12 14:28 kgv Note Added: 0077523
2018-07-12 14:28 kgv Assigned To agv => msv
2018-07-12 15:06 msv Note Added: 0077528
2018-07-12 15:06 msv Status resolved => assigned
2018-07-12 15:06 msv Assigned To msv => abv
2018-07-12 15:06 msv Status assigned => resolved
2018-07-12 15:06 msv Assigned To abv => bugmaster
2018-07-12 15:06 msv Status resolved => reviewed
2018-07-12 16:17 git Note Added: 0077534
2018-07-12 16:22 kgv Note Edited: 0077523
2018-07-12 18:16 bugmaster Test case number => Not needed
2018-07-12 18:17 bugmaster Note Added: 0077549
2018-07-12 18:17 bugmaster Status reviewed => tested
2018-07-12 20:02 kgv Relationship added related to 0026329
2018-07-12 20:02 kgv Relationship added related to 0024589
2018-07-14 12:26 bugmaster Changeset attached => occt master 6f498847
2018-07-14 12:26 bugmaster Status tested => verified
2018-07-14 12:26 bugmaster Resolution open => fixed
2018-07-14 12:41 git Note Added: 0077601
2018-07-14 12:41 git Note Added: 0077602
2018-07-14 12:41 git Note Added: 0077606
2018-07-14 12:42 git Note Added: 0077615
2018-07-14 12:42 git Note Added: 0077618
2018-07-14 19:19 kgv Relationship added parent of 0029960
2019-03-14 21:21 kgv Relationship added related to 0030573
2019-03-29 11:27 kgv Relationship added related to 0030618
2019-07-12 10:48 kgv Relationship added related to 0030842
2019-08-28 10:06 kgv Relationship added parent of 0030924