new_pseudothread

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
LICENSE
VERSION

NAME

new_pseudothread, pth_start, pseudothread_get_threads, pseudothread_count_threads - lightweight "pseudothreads" library

SYNOPSIS

#include <pthr_pseudothread.h>

pseudothread new_pseudothread (pool, void (*run) (void *), void *data, const char *name);
void pth_start (pseudothread pth);
vector pseudothread_get_threads (pool);
int pseudothread_count_threads (void);

DESCRIPTION

Pseudothreads are lightweight, cooperatively scheduled threads.
new_pseudothread creates a new pseudothread. The thread only starts running when you call pth_start. The pool argument passed is used for all allocations within the thread. This pool is automatically deleted when the thread exits. The name argument is the name of the thread (used in thread listings -- see pseudothread_get_threads(3)). You may change the name later. The run and data arguments are the entry point into the thread. The entry point is called as run (data).
pseudothread_get_threads returns a list of all the currently running pseudothreads. This allows you to implement a "process listing" for a program. The returned value is a vector of pseudothread structures (not pointers). These structures are opaque to you, but you can call the pth_get_* functions on the address of each one.
pseudothread_count_threads counts the number of currently running threads.

AUTHOR

Richard Jones <rich@annexia.org>

LICENSE

GNU LGPL (see http://www.gnu.org/)

VERSION

pthrlib-3.0.3