informix multi-threaded / multi-process

2010-09-27  来源:本站原创  分类:Database  人气:125 

Informix support for multiple threads in a process to operate on the database at the same time, multiple threads can either use multiple database connections, multiple threads can share a database connection.

In either way, all require careful analysis and processing multi-threaded shared variables lock, unlock processing.

In this paper, the EC multi-threaded program that several issues:

1, compiled connection

Ec when only a complete file, you can use ESQL to-thread option, ESQL will automatically compile informix connection thread-safe libraries.

When there are multiple files, including ec, c, C files, you can first use the-c and ESQL-thread option to compile the file ec. O files, then use the connector to force the connecting thread safe libraries (th library) .

In conclusion requires the following:
A, ESQL-thread option to add
B, configure the environment variables THREADLIB = POSIX
C, to ensure that the connection is thread-safe libraries.

2, multiple threads sharing a connection

Multiple threads sharing a connection, well after the connection is established, you can use a thread
EXEC SQL set connection 'con' dormant;
Placed in dormant status of the connection, then the connection can be activated by other threads.

Other threads
do (
EXEC SQL set connection 'con';
) While ((sqlca.sqlcode == -1802));
The connection activated, this time can access the database, and only this thread can access the database.
This thread will be connected only set to dormant before it can be used by other threads.

3, multiple threads using multiple connections

A, where each thread requires its own connection to the name of each connection name must be different.
B, must carefully deal with exclusive access to shared variables.

相关文章
  • PHP multi threaded web crawler 2010-07-19

    PHP using Curl Functions can transfer files to complete the various operations, such as simulation of the browser to send GET, POST request, etc., subject to php language itself does not support multi-threaded, so the development crawler efficiency i

  • Process and thread [Z] 2010-09-25

    A brief account of similarities and differences between processes and threads A: The process is running the application, each process has its own separate memory space. An application can start multiple processes simultaneously. For example, IE brows

  • Trees - threaded binary tree 2011-05-17

    1. Introduction n-list node contains binary n +1 empty pointer fields. Use of binary fields in the list of null pointer, stored in a traverse point to the order of nodes under the predecessor and successor node pointer (this pointer as additional "cl

  • Compass --- Search Engine (2) 2010-03-12

    4 Query Analyzer By default, Compass uses its own query parser based on Lucene. Compass allows configure multiple Query Analyzer (with the registered name of the search), or you can override the default Compass Query Analyzer (registered with the def

  • ora 600 error classification 2010-04-09

    Original: http://www.ningoo.net/html/2009/ora-600_internal_error_categories.html ora-600 is the Oracle error for some internal error of a single number (like there is ora-7445). Ora-600 error to determine the specific type, generally in accordance wi

  • Thoughts on java in the thread 2010-05-04

    Thoughts on java in the thread 1. The difference between processes and threads Simple language, it said that the implementation process is a process, and thread can be understood as the process of implementation of a program fragment. Man with a litt

  • Multithreaded Programming 2010-06-25

    Multithreaded Java programming language is a bright spot, it allows the user to easily write multi-threaded program, although the preparation of multi-threaded code to be considered such as security, deadlocks, resource sharing issues, but generally

  • The preparation of MP3 decoder using JAVA - read the file 2010-08-18

    1. Random file access interface on the MP3 decoding requires random read MP3 files, read the document both local disk files, including files from a remote network, two types of file access by the same standard, in order to achieve this goal , first d

  • My first book of the C + + (C + + world travel map) 2011-05-27

    C + + to explore the world tourist map has no shortage of interesting C + + practical grasp the operating principles of the world to learn C + + world "residents" way of thinking free shuttle to the real world and C + + world "My first book

  • Salesperson salesperson salesperson 2010-06-04

    All video format explained ASF ASF is the acronym for Advanced Streaming format, from the literal (Advanced Streaming Format) format, meaning you should see the usefulness of the bar. To put it bluntly, ASF is MICROSOFT Real player and now developed

  • visit Taobao side questions: how to make multi-core CPU, large computing List of all integers and 2010-07-16

    I've seen these two: http://www.javaeye.com/topic/711162?page=13 http://www.javaeye.com/topic/713259 But I am not sure whether I missed something or the majority missed something. Though the chancee of later is slim, I am going to take the chance. Sa

  • C #, DispatcherTimer VS Timer 2010-08-06

    DispatcherTimer class Integrated into the specified intervals and to assign priorities, handle the Dispatcher queue timer. Namespace: System.Windows.Threading In each Dispatcher loop top recalculated DispatcherTimer. Can not guarantee that will happe

  • [Reprinted] Computer terminology 2010-09-02

    1, CPU 3DNow! (3D no waiting) ALU (Arithmetic Logic Unit, Arithmetic Logic Unit) AGU (Address Generation Units, address generating unit) BGA (Ball Grid Array, Ball Grid Array) BHT (branch prediction table, branch prediction table) BPU (Branch Process

  • Multi-threaded database connection pool JDCconectionPool OutOfMemoryException caused by a memory leak causes and solutions 2010-10-04

    Recently wrote a multi threaded application task queue, because a large number of access and manipulate the database, using the JDCconectionPool database connection pool. Found that about two hours running the program will always encounter java.lang.

  • Programmers editor - VIM 2011-01-12

    Programmers editor --VIM dieken at newsmth dot net yubao.liu at gmail dot com A. VIM history 1. ed ed The oldest is the most basic UNIX editor , It was originally the father of UNIX Ken Thompson Written his first ed The application of a regular expre

  • Successful development of the first chapter of the Oracle Applications 2011-08-09

    Successful development of the first chapter of the Oracle Applications 1.3 How to develop database applications 1.3.1 understand the Oracle architecture 1) Do not run under MTS long transaction MTS (Multi Threaded Server) architecture, that is, a con

  • 简单说说STL的内存管理 2015-03-14

    <STL 源码剖析>将其描述为空间配置器,理由是allocator可以将其它存储介质(例如硬盘)做为stl 容器的存储空间.由于内存是allocator管理的主要部分,因此,本文以STL内存管理为出发点介绍allocator 1. 概述STL Allocator是STL的内存管理器,也是最低调的部分之一,你可能使用了3年stl,但却不知其为何物. STL标准如下介绍Allocatorthe STL includes some low-level mechanisms for allocatin

  • webmagic使用手册 2013-12-01

    新版文档地址http://webmagic.io/docs/,此手册已不再更新. 下载及安装 使用maven webmagic使用maven管理依赖,在项目中添加对应的依赖即可使用webmagic: <dependency> <groupId>us.codecraft</groupId> <artifactId>webmagic-core</artifactId> <version>0.4.3</version> <

  • GUI_validator.py 2014-04-17

    from optparse import OptionParser from pprint import pprint from selenium import webdriver from timed_job import Timed_Job, do_GUI_validator_test import os import re import select import signal import subprocess import sys import time #from runner._s

  • DB2 UDB Java stored procedures to solve common problems 2010-04-22

    DB2 UDB Java stored procedures to solve common problems Taken from http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0510law/ Trusted to run the stored procedure, and because they do not depend on external Java Virtual Machine (Java V