MySql & multithreading question

This is a discussion on MySql & multithreading question within the Networking/Device Communication forums, part of the General Programming Boards category; I'm writting a multi-threaded app that connects to a mysql server. What I'm trying to decide is how each thread ...

  1. #1
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681

    MySql & multithreading question

    I'm writting a multi-threaded app that connects to a mysql server. What I'm trying to decide is how each thread will connect.

    I've come up with two basic options:
    1) Have one MYSQL variable and use mutex controls so only one is able to read/write at a time
    2) Each thread would have its own MYSQL variable but setup a mutex method so only one can write at a time.

    I'm leaning towards #2 but I'd like to hear your opinions and/or other ideas.

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Another solution is an overlapped I/O. Queue the requests.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Would mySQL be appropriate for...
    By MK27 in forum Tech Board
    Replies: 10
    Last Post: 05-28-2009, 11:38 AM
  2. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 10:47 PM
  4. .NET Question
    By gvector1 in forum C# Programming
    Replies: 1
    Last Post: 05-21-2003, 12:41 AM
  5. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21