Table of Contents

Name

qthread_disable_worker, qthread_enable_worker - enable or disable a worker for thread scheduling

Synopsis

#include <qthread.h>

int
qthread_disable_worker (qthread_worker_id_t worker);

void
qthread_enable_worker (qthread_worker_id_t shep);

Description

These functions allow worker threads to be enabled and disabled. Workers usually start in the enabled state (the exception is when the QT_HWPAR environment variable is used).

Disabled workers cannot execute threads, but the presumption is that there are other workers on each shepherd. The disabled worker may continue executing its current thread until it either blocks, yields, or exits. Once that thread stops executing, the disabled worker monitors its status and waits to be either destroyed or re-enabled.

When a worker is re-enabled, it begins scheduling threads again.

Return Value

On success, the specified worker thread is marked as disabled and the value QTHREAD_SUCCESS is returned. On failure, an error code is returned.

Errors

QTHREAD_NOT_ALLOWED
The first worker, worker 0, cannot be disabled.


Table of Contents