The mi_vpinfo_vpid() function

The mi_vpinfo_vpid() function obtains the VP identifier of the virtual processor (VP) on which the user-defined routine (UDR) is executing.

Syntax

mi_integer mi_vpinfo_vpid(void)
Valid in client LIBMI application? Valid in user-defined routine?
No Yes
Important: This advanced function can adversely affect your UDR if you use the function incorrectly. Use it only when no regular DataBlade® API function can perform the task you need done.

Usage

The mi_vpinfo_vpid() function returns the VP identifier for the current VP. The current VP is the VP on which the current UDR is running. The VP identifier is a unique integer that the database server assigns to each active VP. The output of the onstat -g glo command displays the VP identifier for a VP in its first output column.

After you have a VP identifier, you can use the following DataBlade® API functions to obtain additional information about the VP environment.

DataBlade® API function
VP-environment information
mi_vpinfo_classid()
VP-class identifier
mi_vpinfo_isnoyield()
Does the current VP belong to a nonyielding VP class?

For information about the VP environment, see the Informix® DataBlade® API Programmer's Guide.

Return values

>=0
The VP identifier for the VP on which the current UDR is running.
MI_ERROR
The function was not successful.