On Thursday 26 June 2008 22:07:09 you wrote: > Hi, > I've been working in a multithread server using libdbi against postgre. > My implementation use a connection per thread and is working well for now, > I'm doing testing yet. I had some problems before, but using the cvs > version with the "_r" functions works fine. > I'm interested about libdbi and thread issues. > > Regards. > Daniel. > > On Thu, Jun 26, 2008 at 2:59 PM, Claudiu CISMARU <[EMAIL PROTECTED]> wrote: > > > So the question is, is there anything that can be done with > > > multithreading > > > at this time? > > > > Create a mutex and lock it per connection. It will solve your problem. > > > > > > -- > > Claudiu Nicolaie CISMARU > > GNU GPG Key: http://claudiu.targujiu.net/claudiu.gpg > > T: 0752095451, 0788358901 > > E: [EMAIL PROTECTED], [EMAIL PROTECTED] > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://sourceforge.net/services/buy/index.php > > _______________________________________________ > > libdbi-users mailing list > > libdbi-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/libdbi-users
Hello again. Well, still no luck. I've just compiled the cvs version of libdbi, modified the source of the test to use instancies (all those *_r functions), but still it crashes with a segfault or sigabort while doing the query. I'm attaching the test I've used along with the connection_pool implementation. unzip the source and edit the db_bench.c. to set the number of threads If you define 1 thread everything works fine for a long time, but should 2 or more threads be defined there go the funny stuff. Edit init.c to set up database connection info. After that just type: cmake . make ./db_bench Note: The source looks a bit strange, because it's ripped out from the piece of software I'm developing right now, and I have not cleaned it much from the unneaded stuff. It seems like it's the only way to get libdbi working ok is to protect every queryf using mutexes, but that in the case the threads (at least in my app) are almost useless.
bench.tar.gz
Description: GNU Zip compressed data
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
_______________________________________________ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users