CPU virtual-processor class
- All session threads
Session threads process requests from the SQL client applications.
- Some internal threads
Internal threads perform services internal to the database server.
The CPU VP class is the default VP class for a UDR. You do not need to specify the CLASS routine modifier in the CREATE FUNCTION or CREATE PROCEDURE statement to have the UDR execute in the CPU VP class.
CREATE FUNCTION getTotal(order_num, state_code)
RETURNS MONEY
...
END FUNCTION
You cannot run an SPL routine in a user-defined VP.
- Preserves concurrency of the CPU VP
- Yields the CPU VP for intense calculations
- Does not perform blocking operating-system calls
- Is thread safe:
- Does not modify static or global data
- Does not allocate local resources
- Does not modify the global VP state
- Does not make unsafe operating-system calls
You can relax some of these programming requirements if you run your C UDR in a user-defined VP class. For more information, see User-defined virtual-processor class (C).