Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Unix multithreaded program using Pro*C
On Mon, 14 May 2001 22:35:18 +0200, "Jeroen" <jeroenthuis_at_gmx.net>
wrote:
>Currently i am developing a (multithreaded) program in C++ which uses Pro*C.
>snip
>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 ?
In addition to Eric's comments, I'd add this as an idea.
Since you have a single thread accessing the database, why are you using the ORACLE multi-threaded libs? Those are for use when you have multiple threads accessing ORACLE simultaneously. Since yours is a multi-thread but only one thread accesses the database, you can just use normal PRO*C calls and libs and do away with all the complexity of multi-threaded PRO*C.
As for blocking calls, I thought the latest versions of PRO*C allowed for non-blocking. If I'm wrong, I know for sure OCI does allow non-blocking calls. Maybe that could be a better choice? AFAIK, OCI is available in both UNIX and NT, so portability wouldn't be an issue? But even OCI won't allow for simultaneous command execution, is that what you call non-blocking?
Also: depending on the flavour of UNIX, multi-threading may be achieved in the same address space. Which means you can do away entirely with shared memory and just use a global heap to pass your SQL command strings. Much less stuff to go wrong and it would still work in NT as well.
Just a few ideas, sorry I can't be more specific.
Cheers
Nuno Souto
nsouto_at_bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html
Received on Tue May 15 2001 - 07:07:49 CDT
![]() |
![]() |