Thread: MySql & multithreading question

  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, 10:38 AM
  2. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  3. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  4. .NET Question
    By gvector1 in forum C# Programming
    Replies: 1
    Last Post: 05-20-2003, 11:41 PM
  5. opengl DC question
    By SAMSAM in forum Game Programming
    Replies: 6
    Last Post: 02-26-2003, 09:22 PM