在main中進行context的初始化
#include
#include
#include
#include
#include
#include
#include
typedef unsigned (winapi * pbeginthreadex_threadfunc)(lpvoid lpthreadparameter);
typedef unsigned * pbeginthreadex_threadid;
exec sql begin declare section;
#define threads 2
struct parameters
;typedef struct parameters parameters;
char username[20],password[20],server[20];
exec sql end declare section;
void sql_error(struct sqlca);
void logon(sql_context);
void logoff(sql_context);
void query1(parameters *);
void query2(parameters *);
void main(int argc,char ** argv)
if (pos=strchr(connstr,'@'))
strcpy(server,connstr);
exec sql enable threads;
exec sql whenever sqlerror do sql_error(sqlca);
for(i=0;ivoid query1(parameters *param)
void query2(parameters *param)
void sql_error(struct sqlca sqlca)
exit(1);
}void logon(sql_context ctx)
void logoff(sql_context ctx)
編譯proc iname=d:/proc/ora_thread1/ora_thread1.pc oname=d:/proc/ora_thread1/ora_thread1.c parse=full include=d:/orant/precomp/public include="d:/program files/microsoft visual studio/vc98/include" threads=yes
linux多執行緒在 proc目錄的結構
linux的多執行緒,其實就是clone系統呼叫的實現的 共享檔案等 首先看個具體的例子 include include include include include include include void print message function void ptr int main ret...
linux多執行緒在 proc目錄的結構
linux的多執行緒,其實就是clone系統呼叫的實現的 共享檔案等 首先看個具體的例子 cpp view plain copy include include include include include include include void print message function v...
pro c初學2 簡單多執行緒例子
name proc mul.pc 預編譯條件 mode oracle parse full 利用多執行緒,更新表中記錄 每個執行緒擁有單獨的上下文環境 表結構 create table accounts account number 36 balance 36,2 include include i...