00001 #ifndef QLOOP_INNARDS_H
00002 #define QLOOP_INNARDS_H
00003
00004 struct qqloop_iteration_queue {
00005 volatile saligned_t start;
00006 saligned_t stop;
00007 saligned_t step;
00008 qt_loop_queue_type type;
00009 union {
00010 volatile saligned_t phase;
00011 struct {
00012 qtimer_t *timers;
00013 saligned_t *lastblocks;
00014 } timed;
00015 } type_specific_data;
00016 };
00017 struct qqloop_static_args;
00018 struct qqloop_wrapper_range;
00019 typedef int (
00020 *qq_getiter_f) (
00021 struct qqloop_iteration_queue * const restrict,
00022 struct qqloop_static_args * const restrict,
00023 struct qqloop_wrapper_range * const restrict);
00024 struct qqloop_static_args {
00025 qt_loop_f func;
00026 void *arg;
00027 volatile aligned_t donecount;
00028 volatile aligned_t activesheps;
00029 struct qqloop_iteration_queue *iq;
00030 qq_getiter_f get;
00031 };
00032 struct qqloop_wrapper_args {
00033 qthread_shepherd_id_t shep;
00034 struct qqloop_static_args *stat;
00035 };
00036 struct qqloop_wrapper_range {
00037 size_t startat, stopat, step;
00038 };
00039 struct qqloop_handle_s {
00040 struct qqloop_wrapper_args *qwa;
00041 struct qqloop_static_args stat;
00042 };
00043
00044 #ifdef QTHREAD_USE_ROSE_EXTENSIONS
00045 struct qtrose_loop_handle_s {
00046 qt_loop_step_f func;
00047 void *arg;
00048 int workers;
00049 int assignNext;
00050 int assignStop;
00051 int assignStep;
00052 volatile aligned_t assignDone;
00053 size_t shepherdsActive;
00054 };
00055 qtrose_loop_handle_t *qtrose_loop_queue_create(
00056 const qt_loop_queue_type type,
00057 const size_t start,
00058 const size_t stop,
00059 const size_t incr,
00060 const qt_loop_step_f func,
00061 void *const restrict argptr);
00062
00063 int qloop_internal_computeNextBlock(
00064 int block,
00065 double time,
00066 volatile qtrose_loop_handle_t * loop);
00067 #endif
00068
00069 #endif