VSTa manual pages  - TFORK (2)

NAME

tfork - create new thread under current process

CONTENTS

Synopsis
Description

SYNOPSIS

#include <std.h>
pid_t tfork(voidfun startfun, ulong arg);

DESCRIPTION

tfork() creates a new thread running under the current process. A thread, unlike a process, shares the address space, permissions, and open files with all other threads of the current process.

A thread starts running at the function pointed to by the startfun argument to tfork(); this function is entered with the single argument arg available. This function should not return to its "caller"; exit(2) should be used when the thread wishes to complete.

tfork()’s return value is the thread process ID of the new thread. Note that a thread process ID is local to the PID of the containing process; see notify(2) for an example of selecting a thread within a process.


TFORK (2)
Generated by manServer 1.06 from tfork.2 using man macros.