Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Multithreading under NT
Hi,
this is my problem:
unsigned long __stdcall Thread(void *)
{
Cda_Def cda;
long value = 1;
memset(&cda, 0, sizeof(cda));
EnterCriticalSection(&cSection);
oopen(&cda, &lda, 0, -1, -1, 0, -1);
oclose(&cda);
LeaveCriticalSection(&cSection);
Sleep(1000);
EnterCriticalSection(&cSection);
LeaveCriticalSection(&cSection);
return 0;
}
this thread hangs if it is spawned twice. The second thread hangs in oopen wich causes the first thread to wait infinitly entering the critical section after the sleeps.
There are three possiblities to make it work:
1. omit the oclose
2. force a thread switch before the oclose (put it into the second critical
section)
3. omit the opinit(OCI_EV_TSF) at startup.
It seems that oopen waits infinitly calling WaitForSingleObject, but i'm not shure.
Any suggestions ?
Ingo Eichenseher
Lehrstuhl fuer Angewandte Mathematik
Technische Universitaet Muenchen
www.appl-math.tu-muenchen.de/~ieichens
Received on Tue Oct 28 1997 - 00:00:00 CST