dbTalk Databases Forums  

Multi Threading in VC++ 7.x environment

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Multi Threading in VC++ 7.x environment in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul Aitman
 
Posts: n/a

Default Multi Threading in VC++ 7.x environment - 06-25-2005 , 11:38 AM






Hi All,

Saw the posts from Earl about how he got MySQL++ working in a
multi-threaded environment under Linux.

Am trying to do the same thing under VC 7.1x and on occasions am
encountering some slightly strange behaviour.

Each thread I create, has its own Connection object to the database, but
I was just wondering what dangers are there lurking when multiple
threads try to write to the same table.

I have tried to program it to be as thread safe as possible, I was just
wondering if there were any specific dangers I should be aware of when
using MySQL++.

TIA,

--
Paul Aitman


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Earl Miles
 
Posts: n/a

Default Re: Multi Threading in VC++ 7.x environment - 06-25-2005 , 02:34 PM






Paul Aitman wrote:
Quote:
Each thread I create, has its own Connection object to the database, but
I was just wondering what dangers are there lurking when multiple
threads try to write to the same table.

I have tried to program it to be as thread safe as possible, I was just
wondering if there were any specific dangers I should be aware of when
using MySQL++.
Theoretically using one connection per thread should be completely safe,
regardless of the table. Realistically, I've had MySQL hang up from time to time
if I hit a single table too hard from multiple threads. I'm not sure that's the
culprit, but either way, it's been a pretty nasty occurance in my test
environment, and I'm happy to work to avoid it if I don't get mysql hangups by
doing so.

Threads cause lots of odd behavior in general, and it's rarely clear what
particular issue is actually causing the behavior. Make sure you're using the
threadsafe library (I assume there is a threadsafe DLL for windows), that was
definitely key in my early experiments.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.