User-defined virtual processors

User-defined classes of virtual processors protect the database server from ill-behaved user-defined routines.

An ill-behaved user-defined routine has at least one of the following characteristics:
  • Does not yield control to other threads
  • Makes blocking operating-system calls
  • Modifies the global VP state
A well-behaved C-language UDR has none of these characteristics. Run only well-behaved C-language UDRs in a CPU VP.
Warning: Execution of an ill-behaved routine in a CPU VP can cause serious interference with the operation of the database server, possibly causing it to fail or behave erratically. In addition, the routine itself might not produce correct results.
To ensure safe execution, assign any ill-behaved user-defined routines to a user-defined class of virtual processors. User-defined VPs remove the following programming restrictions on the CPU VP class:
  • The requirement to yield the processor regularly
  • The requirement to eliminate blocking I/O calls

Functions that run in a user-defined virtual-processor class are not required to yield the processor, and they might issue direct file-system calls that block further processing by the virtual processor until the I/O is complete.

The normal processing of user queries is not affected by ill-behaved traits of a C-language UDR because these UDRs do not execute in CPU virtual processors. For a more detailed explanation of ill-behaved routines, see the IBM® Informix® DataBlade API Programmer's Guide.