Multithreading.

This is a discussion on Multithreading. within the C++ Programming forums, part of the General Programming Boards category; Hello, i've been learning winsock programming all day long...I learned Receiving, Sending, Accepting connections. Now, i was having fun until ...

  1. #1
    deletedforumuser
    Guest

    Multithreading.

    Hello, i've been learning winsock programming all day long...I learned Receiving, Sending, Accepting connections.

    Now, i was having fun until i realised i can't accept connections and Actually (Do the server work <<Receiving and sending data<<)


    I need a way to multithread to actually make it Accept connections and send/receive data at the same time.

    I have no idea how to do multithreading. Well, i one day used a multithread function, but if you can please tell me what is the best library to use to multithread?

    Thank you.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    This is a Windows programming question. Wrong forum.

  3. #3
    deletedforumuser
    Guest
    Multithreading isn't only Windows programming...

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,691
    >> what is the best library to use to multithread?
    "Best"?
    For windows, the windows API. For everything else, the Posix API. If you want a cross platform and C++ API, then boost::thread.

    gg

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    2,545
    Quote Originally Posted by Codeplug View Post
    >> what is the best library to use to multithread?
    "Best"?
    For windows, the windows API. For everything else, the Posix API. If you want a cross platform and C++ API, then boost::thread.

    gg
    Posix API (pthreads) works on any platform if you install the libraries.

    check out this thread where I helped out a guy with some threading stuff using pthreads.

  6. #6
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    You are presuming that multithreading is the only solution -- it isn't. There's also select(), which was the way this was traditionally handled before threads became widespread.

    Threading might be the best solution here or it might not. We don't know enough to say for sure.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multithreading (flag stopping a thread, ring buffer) volatile
    By ShwangShwing in forum C Programming
    Replies: 3
    Last Post: 05-19-2009, 08:27 AM
  2. multithreading in C++
    By manzoor in forum C++ Programming
    Replies: 19
    Last Post: 11-28-2008, 12:20 PM
  3. Question on Multithreading
    By ronan_40060 in forum C Programming
    Replies: 1
    Last Post: 08-23-2006, 08:58 AM
  4. Client/Server and Multithreading
    By osal in forum Windows Programming
    Replies: 2
    Last Post: 07-17-2004, 04:53 AM
  5. Multithreading
    By JaWiB in forum Game Programming
    Replies: 7
    Last Post: 08-24-2003, 10:28 PM

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