RaftLib
0.3a
C++ Stream Processing Template Library
|
Public Member Functions | |
pool_schedule (Map &map) | |
virtual | ~pool_schedule () |
virtual void | start () |
![]() | |
Schedule (Map &map) | |
virtual | ~Schedule () |
virtual void | init () |
void | scheduleKernel (raft::kernel *const kernel) |
Protected Member Functions | |
virtual bool | scheduleKernel (raft::kernel *const kernel) |
![]() | |
virtual void | handleSchedule (raft::kernel *const kernel)=0 |
Static Protected Member Functions | |
static bool | container_min_input (kernel_container *const a, kernel_container *const b) |
static bool | container_min_output (kernel_container *const a, kernel_container *const b) |
![]() | |
static raft::kstatus | checkSystemSignal (raft::kernel *const kernel, void *data, SystemSignalHandler &handlers) |
static raft::kstatus | quitHandler (FIFO &fifo, raft::kernel *kernel, const raft::signal signal, void *data) |
static void | invalidateOutputPorts (raft::kernel *kernel) |
static bool | kernelHasInputData (raft::kernel *kernel) |
static bool | kernelHasNoInputPorts (raft::kernel *kernel) |
Protected Attributes | |
const float | diff_weight = .20 |
decltype(std::thread::hardware_concurrency()) const | n_threads |
std::vector< std::thread * > | pool |
std::vector< kernel_container * > | container |
std::size_t | kernel_count = 0 |
std::remove_reference< decltype(container.end()) >::type | container_it |
![]() | |
SystemSignalHandler | handlers |
kernelkeeper & | kernel_set |
kernelkeeper & | source_kernels |
kernelkeeper & | dst_kernels |
Additional Inherited Members | |
![]() | |
static bool | kernelRun (raft::kernel *const kernel, volatile bool &finished, jmp_buf *gotostate=nullptr, jmp_buf *kernel_state=nullptr) |
pool_schedule::pool_schedule | ( | Map & | map | ) |
pool_schedule - constructor, takes a map object, calling this will launch threads. scheduler itself is also run as a thread.
map | - Map& |
poolschedule.cpp -
Copyright 2014 Jonathan Beard
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
initialize container objects
initialize threads
|
virtual |
destructor, deletes threads and cleans up container objects.
join threads
delete threads
delete containers
|
staticprotected |
container_min - returns true if the input queue of a has fewer items than the input queue of b
a | - kernel_container * const |
b | - kernel_container * const |
|
staticprotected |
container_max - returns true if the output queue of a is greater than b.
a | - kernel_container * const |
b | - kernel_container * const |
|
protectedvirtual |
BEGIN FUNCTIONS scheduleKernel - override base class function in order to add kernels to the right place.
kernel | - raft::kernel* |
get a container
|
virtual |
start - call to start executing map, at this point the mapper sould have checked the topology and everything should be set up for running.
we want to get the max queue occupancy
some message exists
remove kernel
all done, shutdown
Implements Schedule.
|
protected |
max_heap_container - sorted by max output-queue occupancy
|
protected |
END FUNCTIONS, BEGIN VAR DECLS The thread has to have this much more "work" than the previous thread in order to get moved ot a new thread. Used in pool_schedule::start().
|
protected |
total # of hardware supported threads
|
protected |
used as a thread pool