Hi,
Assuming that you are using a multithread safe libmysql, I suggest you to
have a look at your error code first:
Error code 1064 suggests that you send a bad query to mysql, maybe your
pool->query isn't indeed MT safe, so manipulating this variable requires a
mutex.
Error code 1062 suggests that you try to insert duplicate key in your table:
remove this key ( bad suggestion ) or check that your pool doesn't send more
than one time the same query ( perhaps, the mutex on pool->query is enough )

Try to limit mutexes only where it's necessary and be aware where you're
locking and unlocking them.

Regards,
Geoffroy.

2007/5/30, Ace <[EMAIL PROTECTED]>:

Hi Friends,

I am facing problem while using MySQL in multi-threaded environment. I am
using C lang for developement.

I maintain MySQL connection pool between threads but with increase in
number
of requests, it started reporting
following errors -

==================================
Server Errors:
Error: 1064 :Parse error
Error: 1062 :Duplicate entry
==================================

Then I used mutexes around MySQL API calls and it worked. But seems use of
mutex impacts the performance, is this true?

Any other solution to this than mutex or any out-of-box solution that
might
have worked?

Thanks for your help!!!


--

Cheers,
Rajan

Reply via email to