Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Unix multithreaded program using Pro*C

Unix multithreaded program using Pro*C

From: Jeroen <jeroenthuis_at_gmx.net>
Date: Mon, 14 May 2001 22:35:18 +0200
Message-ID: <9dpfdo$1of9$1@scavenger.euro.net>

Question,

Currently i am developing a (multithreaded) program in C++ which uses Pro*C. I already have it runing on windows NT, now i am porting it to Unix ( Dec Alpha ). The program basically starts up a thread that performs database retrieves and updates. The main thread passes all the commands to be performed by the database thread in a piece of shared memory. The database thread gets the data from the shared memory, performs the database action, and puts the result back in the shared data ( this is done, because the Pro*C calls are blocking, and i want the app to continue whatever happens). The class which i use as shared memory, contains several static members which can be set and get ( incapsulated by mutexes ). This class also contains some pointers. These pointers point to memory, allocated by the mainthread using new operator. The problem is that i get all kinds of errors, memory faults, segmentation fault even a stack overflow. This errors occur in the Pro*C calls, but i cannot find the problem. I am afraid the way memory is shared between threads in NT differs from Unix, but i am not sure. I also created some Pro*C code using statements as SQL ENABLE THREADS and use contexes, but it doesnt help, which i guessed because there is only one thread accessing the database. I compile and link using multithreaded libraries. Does anybody have a clue of what is going on here ?

Thanks in advance, Jeroen Received on Mon May 14 2001 - 15:35:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US