unicode + multithreaded = crash

2004-07-21 Thread Silvio Lopes de Oliveira
MySQL Server 4.1.1 alpha
MyODBC Connector: 3.51.08

Hello all,

I am experiencing the following problem: I have an dialog-based MFC app using the 
CDatabase class to connect to a MySQL DB using ODBC. My connection string specifies a 
DSN with the connection information. Additionally, this is a Unicode compilation ( 
Project Properties > General > Use Unicode Character Set ). My test app has a 
CWinThread-derived class named CDBThread, with a CDatabase member. 
CDBThread::InitInstance() calls OpenEx() for the CDatabase member. So far so good.

For the app's InitInstance, all I do is call AfxBeginThread() twice, to create two 
threads of type CDBThread. The application crashes when the db thread tries to connect 
to the db.

However, there are two things I can do to avoid the crash:

- Start only ONE CDBThread instead of TWO.
- Compile using multi-byte character set instead of Unicode.

Of course, these are both unnaceptable solutions. But it seems the problem is related 
only to multi-threaded apps using Unicode. Each CDBThread has its own CDatabase 
object, so no additional synchronization should be needed as two separate db 
connections should be created, right?

Oh, yeah, I tried replacing the MySQL db with an MS Access db and the problem went 
away. Any ideas? Is this a bug?

Here's the stack at the time of the crash:

odbc32.dll!1f7b7e08()   
odbc32.dll!1f7b8cd1()   
odbc32.dll!1f7c59b8()   
odbc32.dll!1f7a2f84()   
odbc32.dll!1f7a2cb8()   
msvcrt.dll!___updatetlocinfo()  + 0x40  
[EMAIL PROTECTED]()  + 0x67 
[EMAIL PROTECTED]()  + 0xb  
[EMAIL PROTECTED]()  + 0xa  
[EMAIL PROTECTED]()  + 0x2bf
[EMAIL PROTECTED]()  + 0x1a250  
[EMAIL PROTECTED]()  + 0x8f4
[EMAIL PROTECTED]()  + 0x144
[EMAIL PROTECTED]()  + 0x3c 
>   mfc71ud.dll!CWnd::GetActiveWindow()  Line 193 + 0xf C++



// From my db thread class:
BOOL CDBThread::InitInstance()
{

m_db.OpenEx( _T( "ODBC;DRIVER=MySQL ODBC 3.51 Driver;DSN=dbtest;" ) );
return TRUE;
}


// From the main app:
BOOL CDbtestApp::InitInstance()
{
// (...) MFC wizard stuff here

m_Thread[ 0 ] = AfxBeginThread( RUNTIME_CLASS( CDBThread ) );
m_Thread[ 1 ] = AfxBeginThread( RUNTIME_CLASS( CDBThread ) ); // Comment this 
out = no crash

// (...) more MFC wizard stuff here
}


Thank you,

Silvio Lopes de Oliveira
Software Engineer




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



OS X Version < 4.1 Multithreaded?

2004-06-11 Thread John May
I've heard some recent rumblings that MySQL before 4.1 wasn't 
multithreaded on OS X.  However, in actual usage I see every 
indication that is IS.

Does anyone have a definitive answer either way?  Thanks!
- John
--
---
John May : President  <http://www.pointinspace.com>
Point In Space Internet Solutions [EMAIL PROTECTED]
 LPA Corporate Partner / FSA Associate / ACN Member
  Professional Lasso / PHP / MySQL / FileMaker Pro Hosting
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Multithreaded?

2003-10-23 Thread Jeremy Zawodny
On Tue, Oct 21, 2003 at 10:13:55AM -0700, Greg(Bear) Casad wrote:
>
> All installations of mysql I have run ps -fax will show about 5
> mysql proccess running, even at idle.

mysql or mysqld?

> I compiled on a Redhat 9 box, it did find pthreads however ps
> -fax show 1 mysqld process running.

Is it using NTPL?

> Is there a spot to configure spare proccess? -- Or verify that it is
> indeed compiled muli-threaded??

The MySQL server (mysqld) is *always* multi-threaded.

As far as "spares", you might want to look at setting your
thread_cache to a non-zero value.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

MySQL 4.0.15-Yahoo-SMP: up 39 days, processed 1,493,368,938 queries (439/sec. avg)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Multithreaded?

2003-10-21 Thread Mihai RUSU
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 21 Oct 2003, Greg(Bear) Casad wrote:

> All installations of mysql I have run ps -fax will show about 5 mysql
> proccess running, even at idle.

Yep.

> I compiled on a Redhat 9 box, it did find pthreads however ps -fax
> show 1 mysqld process running.

NPTL (RedHat9 comes with NPTL, among other differences between NPTL and 
old Linuxthreads was this that the threads show as a single process now).

http://people.redhat.com/drepper/nptl-design.pdf

(btw, can you get a working mysql 4.0.x statically compiled mysqld version
on RedHat9 ? I have problems with statically linked programms on NPTL
enabled glibc, including mysql. Please compile a 4.0.x version, run it and
try to just enter a session with mysql CLI and exit the session and check
if the mysqld has crashed/restarted on your exit, check the uptime by
"status" command" thanks!)

> Is there a spot to configure spare proccess? -- Or verify that it is
> indeed compiled muli-threaded??
> 
I dont know, Im very curious about that too...

- 
Mihai RUSUEmail: [EMAIL PROTECTED]
GPG : http://dizzy.roedu.net/dizzy-gpg.txtWWW: http://dizzy.roedu.net
   "Linux is obsolete" -- AST
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/lXWpPZzOzrZY/1QRAoaVAKCmY9lS2sho+m4Qov46HyF38ef5NgCgzOs/
lVFCmBm75xAqgpwTJd0nD5c=
=hItY
-END PGP SIGNATURE-

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Multithreaded?

2003-10-21 Thread Dathan Vance Pattishall
On red hat systems threads show up in a normal processlist. Thoese are
threads that your seeing, some for connections others to do some innodb
tasks and/or replication. 

- Dathan Vance Pattishall
  - Sr. Programmer and mySQL DBA for FriendFinder Inc.
  - http://friendfinder.com/go/p40688


-->-Original Message-
-->From: Greg(Bear) Casad [mailto:[EMAIL PROTECTED]
-->Sent: Tuesday, October 21, 2003 10:14 AM
-->To: [EMAIL PROTECTED]
-->Subject: Multithreaded?
-->
-->All installations of mysql I have run ps -fax will show about 5 mysql
-->proccess running, even at idle.
-->I compiled on a Redhat 9 box, it did find pthreads however ps
-fax
-->show 1 mysqld process running.
-->Is there a spot to configure spare proccess? -- Or verify that it is
-->indeed compiled muli-threaded??



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Multithreaded?

2003-10-21 Thread Greg\(Bear\) Casad
All installations of mysql I have run ps -fax will show about 5 mysql proccess 
running, even at idle.
I compiled on a Redhat 9 box, it did find pthreads however ps -fax show 1 mysqld 
process running.
Is there a spot to configure spare proccess? -- Or verify that it is indeed compiled 
muli-threaded??


multithreaded application core dumps

2001-11-19 Thread Narayana G.Nayak

Hi All,

I have a multithreaded application using pthread library on solaris2.6.
Application also uses mysql library to deal with mysql server. The version
that I am using is 3.23.33. I am using the following libraries mysqlclient_r
and z. But the application core dumps after running for sometime. What could
be wrong here. Is this a known bug in multithreaded environment? I have
included the stack trace below.

#0  0x380b8 in my_real_read ()
#1  0x38224 in my_net_read ()
#2  0x34a6c in net_safe_read ()
#3  0x36580 in mysql_real_query ()
#4  0x37368 in mysql_query ()

Thanks.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




gjt jdbc multithreaded?

2001-03-09 Thread Sheer El-Showk

Hi,

I'm trying to load test an old application that was written using the gjt
jdbc drivers for mysql.

When I start hitting it with ~10+ concurrent application sessions (each of
which do multiple, short db queries) I start seeing things like this crop
up in the log file:

java.lang.NumberFormatException
at org.gjt.mm.mysql.ResultSet.getTimestamp(ResultSet.java:784)
at org.gjt.mm.mysql.ResultSet.getObject(ResultSet.java:1103)
at org.gjt.mm.mysql.ResultSet.getObject(ResultSet.java:1127)
at my applications classes ...


The application is a multithreaded server using normal java threads.

Does anyone know if gjt is supposed to be thread-safe (a cursory search of
the homepage and search engines didn't yield an answer either way --
please note the word _cursory_ , mispelled though it may be, in any future
criticism)?

If not, is twz (though that's non-commercial use only right?)?  Is there a
fully open-source (or at least commercially usable) multi-threaded java
driver for mysql?

Please cc my address ([EMAIL PROTECTED]) in any response.

Thanks in advance,
Sheer


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Multithreaded mysql client dumps core

2001-01-16 Thread mills

I'm using mysql-3.23.29-gamma on Solaris 2.6 sparc.  I have a
multithreaded mysql client that is linked to libmysqlclient_r.
On startup, it dumps core after mysql_init() is called.  More
specifically, the fault is during the getservbyname() call in
mysql_once_init(), which is part of libmysql.c.

The core dump only happens if /etc/nsswitch.conf specifies:

services:   files nis

and /etc/inet/services does not contain:

mysql   3306/tcp

It happens during the search of the NIS services map for the
mysql service.  I can't tell if it's due to a bug in the
/usr/lib/nss_nis.so.1 library or something wrong with the way
that the function is invoked.

If anyone else is running into this problem, the workaround is
either to fix /etc/nsswitch.conf or /etc/inet/services.  Has
anyone seen this problem?  I haven't seen the mysql service name
documented anywhere.  Should it be?


-- 
-Gary Mills--Unix Support--U of M Academic Computing and Networking-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php