NPA_Spawn_Thread
Schedules execution of a blocking or non-blocking asynchronous event, or a timer-interrupt-level callback.
LONG NPA_Spawn_Thread ( LONG npaHandle void (*executeRoutine)(), LONG parameter, LONG clockTicks, LONG flag );
The following table lists return values and descriptions.
NPA_Spawn_Thread is used to schedule an asynchronous background thread for a CDM or HAM that becomes active after the time specified in the clockTicks parameter. If the value in clockTicks is zero, the thread is immediately scheduled. Whether scheduling is immediate or delayed, the thread is initiated by NetWare calling the entry point whose address was passed into NPA_Spawn_Thread as an argument. NPA_Spawn_Thread can be used to set up an entry point for a background timer or to create a designated background process that can run throughout the time that the CDM or HAM is loaded in file server memory. An example of a background process is the HAM's timeout handler that monitors the allowable execution time of an I/O request specified in the timeoutAmount field of a HACB.
If the value of the flag parameter is 0, NPA_Spawn_Thread schedules a non-blocking thread. If the spawned thread is non-blocking, no blocking calls can be issued during its context.
If the value of the flag parameter is 1, NPA_Spawn_Thread schedules a blocking thread from which other blocking calls can be made. However, as much as possible, blocking calls should be kept to a minimum to avoid impact on server performance.
If the value of the flag equals 2 (timer interrupt time callback), the execute function must adhere to interrupt level constraints. We suggest that an interrupt time callback keep its execution time under 20 milliseconds.
NPA_Spawn_Thread is a one-shot thread. In order to reschedule an asynchronous thread for execution, NPA_Spawn_Thread must be called again.