Unix Programming - linux multithreaded client - mysql

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2004 > linux multithreaded client - mysql





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author linux multithreaded client - mysql
darren

2004-06-30, 6:02 pm

Hi all,

I am writing a multi-threaded client that requires shared access to a single
MySQL
connection. The environment is Redhat 7.3 with the patched
mysql-3.23.58-2.71.i386.rpm
installed and compiled with -l libmysqlclient_r.

The connection is made from the main thread and a MYSQL_RES* myres declared
from the child
thread is used to fetch results back to the thread. I get a Segmentation
fault the first
instance my child thread (only one) accesses MYSQL_RES through
mysql_num_rows(myres).
(gdb informed me that this is due to mysql_num_rows from
libmysqlclient_r.so.10)

I have read a few docs about writing mysql multi-threaded clients and have
called
my_init() in my main prog and my_thread_init() at the first line of my
thread handler.

Any ideas?



Vikram

2004-07-01, 3:20 am

"darren" <teodarren@myrealbox.com> wrote in message news:<40e2dbf2$1@news.starhub.net.sg>...
> Hi all,
>
> I am writing a multi-threaded client that requires shared access to a single
> MySQL
> connection. The environment is Redhat 7.3 with the patched
> mysql-3.23.58-2.71.i386.rpm
> installed and compiled with -l libmysqlclient_r.
>
> The connection is made from the main thread and a MYSQL_RES* myres declared
> from the child
> thread is used to fetch results back to the thread. I get a Segmentation
> fault the first
> instance my child thread (only one) accesses MYSQL_RES through
> mysql_num_rows(myres).
> (gdb informed me that this is due to mysql_num_rows from
> libmysqlclient_r.so.10)
>
> I have read a few docs about writing mysql multi-threaded clients and have
> called
> my_init() in my main prog and my_thread_init() at the first line of my
> thread handler.
>
> Any ideas?


It would be better if you ask the question in mailing.database.mysql
group as its more specific to MySQL.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com