[unixODBC-support] pthread and unixODBC problem

José M. Puyal josemaria.puyal at dialcom.com
Fri Oct 14 09:14:20 BST 2005


El jue, 13-10-2005 a las 17:01 +0100, Nick Gorham escribió:
> José M. Puyal wrote:
> 
> >Hi Nick,
> >
> >We have found the problem,
> >
> >In our pthreads we have defined 
> >
> >pthread_attr_setstacksize( &tAttr, 16384 ); 
> >
> >With this attribute for the stack size the aplication fails when the
> >thread creates a new connection or database handle, maybe because the
> >memory space needed to allocate the handle (we are not sure). If we
> >comment that line all works fine, but we can only create about 300
> >threads, after that no new threads can be created.
> >
> >¿Do you know anything about this?
> >  
> >
> Well I would guess something (I suspect the driver) is requireing more 
> than 16K on the stack. I expect the limit of threads is your available 
> memory. Maybe there is a figure >16k that will work and allow you to 
> create more threads.
> 
> Do you mean you want 300 concurrent threads, or are you creating and 
> ending threads?
> 

Hi Nick,

We need more than 300 concurrent threads, our tests run about 4000
concurrent threads (in red hat 8). Until these days we don't have any
problems because our database connection pool created the connections
out of the threads, but nowadays sometimes when all the connections of
the pool are in use, a thread can create a new one on demand.

what do you mean with  " Maybe there is a figure >16k that will work and
allow you to create more threads" Could you explain it, please?

Thanks in advance and regards.

Josemari 





More information about the unixODBC-support mailing list