the parallel task helper
VectorTask
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 1 | construct a new parallel task executator |
| Solve | 2 | Run in sequence |
| Run | 1 | Run in parallel |
| Allocate | 1 | allocate a block of result output memory data for one thread task |
| ParallelFor | 1 | implements the parallel for use the thread pool |
| CopyMemory | 1 | copy all data of span to the target region inside v |
| CopyMemory | 1 |
03 Properties
| Name | Overloads | Summary |
|---|---|---|
| num_threads | 1 | |
| span_size | 1 |
04 Fields
| Name | Overloads | Summary |
|---|---|---|
| workLen | 1 | the input pending task sequence size |
| sequenceMode | 1 | set this flag value to value TRUE for run algorithm debug |
| cpu_count | 1 | VectorTask.n_threads |
| n_threads | 2 | set number of cpu threads for run current VectorTask parallel. |
05 Members
Int32, Boolean, Nullable(Of Int32))construct a new parallel task executator
the thread count for run the parallel task is configed via the VectorTask.n_threads by default.
| Name | Type | Description |
|---|---|---|
nsize | Int32 | - |
Int32, Int32, Int32)solve a sub task
| Name | Type | Description |
|---|---|---|
start | Int32 | index offset start from zero |
ends | Int32 | - |
Run in sequence
Run in parallel
Boolean)allocate a block of result output memory data for one thread task
element count problem see the dev comments about the parameter thread_id from function VectorTask.ParallelFor()
| Name | Description |
|---|---|
TOut |
| Name | Type | Description |
|---|---|---|
all | Boolean | allocate all result(len=VectorTask.workLen) when set this parameter value TRUE or just for cpu worker thread(len=VectorTask.cpu_count) if set this parameter value FALSE? |
Int32, Int32)implements the parallel for use the thread pool
| Name | Type | Description |
|---|---|---|
span_size | Int32 | - |
thread_id | Int32 | the thread id is start from based ZERO, but the upper index of the thread id is equals to the VectorTask.cpu_count, so group result vector should has value with |
``0(), ``0(), Int32)copy all data of span to the target region inside v
| Name | Description |
|---|---|
T |
| Name | Type | Description |
|---|---|---|
v | ``0() | - |
span | ``0() | may be a part of region inside v |
start | Int32 | - |
the input pending task sequence size
set this flag value to value TRUE for run algorithm debug
set number of cpu threads for run current VectorTask parallel. this thread value MUST BE configured before construct of the task object.
T(), Int32, Int32)