IrisWSScheduler

IrisWSScheduler — A work-stealing scheduler

Synopsis

#define             IRIS_WSSCHEDULER_CONST              (obj)
                    IrisWSScheduler;
IrisScheduler*      iris_wsscheduler_new                (void);
IrisScheduler*      iris_wsscheduler_new_full           (guint min_threads,
                                                         guint max_threads);

Object Hierarchy

  GObject
   +----IrisScheduler
         +----IrisWSScheduler

Description

IrisWSScheduler is a work-stealing scheduler implementation for iris. It uses an IrisWSQueue per thread for storing work items yielded from the the worker thread itself. Since this can be done lock-less in some situations, it helps when workloads create many recursive tasks.

A global queue is used for work items generated from outside the schedulers set of threads. If a new work-item is created from the schedulers thread, it will be put into a private queue for the running thread.

To prevent thread-starvation, if a thread runs out of work items it will try to steal work from other threads.

The IrisWSScheduler has not yet been proven for correctness. Until that happens you should test your work-loads appropriately.

Details

IRIS_WSSCHEDULER_CONST()

#define             IRIS_WSSCHEDULER_CONST(obj)

obj :


IrisWSScheduler

typedef struct _IrisWSScheduler IrisWSScheduler;


iris_wsscheduler_new ()

IrisScheduler*      iris_wsscheduler_new                (void);

Creates a new instance of the work-stealing scheduler.

Returns :

the newly created IrisWSScheduler.

iris_wsscheduler_new_full ()

IrisScheduler*      iris_wsscheduler_new_full           (guint min_threads,
                                                         guint max_threads);

Creates a new instance of the work-stealing scheduler with a specified range of active threads.

min_threads :

a guint containing the minimum number of threads

max_threads :

a guint containing the maximum number of threads

Returns :

the newly created IrisWSScheduler.