Home | Previous Page | Next Page   Programming Guidelines >

C Programming Guidelines

To take advantage of Informix database server architecture, you must use the DataBlade API and follow the guidelines in the IBM Informix: DataBlade API Programmer's Guide when you write user-defined routines in C.

The Informix database server uses virtual processors (VPs) to service multiple client-application SQL requests. The database server breaks the SQL request into distinct tasks, based on the resource that the task requires. Different VP types, called virtual processor classes (VP classes), service different kinds of tasks.

The CPU virtual processor (CPU VP) acts as the central processor for client-application SQL requests. When a client application establishes a connection, the CPU VP creates the session thread for that client application. A CPU VP runs multiple session threads to service multiple SQL client applications. Because a session thread is the primary thread for the processing of SQL requests, any C routines in an SQL request normally execute in the CPU VP. However, your routine must be well-behaved by following certain guidelines to avoid loss of performance and data.

For example, a well-behaved user-defined routine that runs in the CPU VP must fulfill the following requirements:

Some of these restrictions are relaxed if you assign your routine to a user-defined virtual processor. A user-defined virtual processor is a VP that you create. It runs only those routines that you assign to it.

The IBM Informix: DataBlade API Programmer's Guide describes in detail each of these guidelines and their possible workarounds using user-defined virtual processors.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]