Figure 4-1 Informix Dynamic Server Architecture
The following sections discuss how:
See the INFORMIX-Universal Server Administrator's Guide for information on all types of virtual processors. Thread Management A virtual processor runs one thread at a time. A virtual processor services multiple threads concurrently by switching between them. The virtual processor runs a thread until the thread yields; then switches to the next thread that is ready to run. The virtual processor continues this process and eventually returns to the original thread when that thread is ready to continue. Because a virtual processor switches between threads, it can keep the CPU processing continually. Your user-defined routines must explicitly yield by calling mi_yield() before entering resource-intensive sections of code. Use DataBlade API calls whenever possible because they implicitly yield at appropriate points. If you have more than one CPU VP, a thread that has yielded resumes in the first available CPU VP, which is not necessarily the one in which it began. Memory Management Virtual processors save information about threads in shared memory. Shared memory is an operating system feature that allows Informix Dynamic Server threads and processes to share data. Shared memory enables the database server to reduce overall memory use because the virtual processors do not need to maintain private copies of the data. Because a virtual processor saves information about the state of the thread in shared memory, the thread can be accessed by any virtual processor. DataBlade API memory allocation functions, such as mi_alloc(), allocate memory in the shared memory pool. Standard C memory allocation functions, such as malloc(), allocate memory on the data segment or heap of the virtual processor, which cannot be accessed after the thread migrates. Memory allocated by malloc() might overwrite memory addresses that will be needed by the database server.
1. Open the ONCONFIG file in a text editor.
2. Locate the VPCLASS variable.
3. Specify the parameters for the VPCLASS variable.
4. Save and close the ONCONFIG file.
You can see the new virtual processor in the onstat -g glo command output as a new process.
0