c++ threading

This is a discussion on c++ threading within the C++ Programming forums, part of the General Programming Boards category; i am looking for help with learning c++ threading ive googled alot and havent come across a good sample that ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    319

    c++ threading

    i am looking for help with learning c++ threading
    ive googled alot and havent come across a good sample that makes it clear enough about how to use threading
    can someone care to explain , also is it api and shouldent threading be in my c++ books that i paid for
    thanks

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    threads are not part of the c or c++ language because they are operating-system dependent. what os and compiler are you using?

    shouldent threading be in my c++ books that i paid for
    depends on the book you bought -- if you bought a book for a specific os, then it will probably cover threads for that os. General c++ language introduction books do not normally cover os-specif api functions.
    Last edited by Ancient Dragon; 12-28-2005 at 12:59 PM.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    319
    windows xp sp2
    visual studio 6.0 c++
    i am trying to create a while loop in a new thread , but also run the rest of the code

  4. #4
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    see MSDN at www.msdn.microsoft.com -- search for CreateThread() win32 api function. Looks complicated but isn't really because most of the parameters are 0. All you really need is the name of your thread proc function (as described in the Createthread article) and the last parameter, pointer to DWORD that will be the Thread ID when the thread is created.

  5. #5
    Registered User
    Join Date
    Nov 2005
    Posts
    52
    www.boost.org
    Look up Boost::Thread - it's a cross platform, C++ threading abstraction based on the Berkeley socket API mostly. Highly recommended in my book.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cross Threading Problems
    By (TNT) in forum C# Programming
    Replies: 1
    Last Post: 12-09-2006, 09:59 AM
  2. C++ Threading?
    By draggy in forum C++ Programming
    Replies: 5
    Last Post: 08-16-2005, 12:16 PM
  3. Problem with threading
    By osal in forum Windows Programming
    Replies: 6
    Last Post: 07-21-2004, 12:41 PM
  4. starting to learn multi threading
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 06-09-2004, 01:44 PM
  5. Threading
    By threads in forum C# Programming
    Replies: 0
    Last Post: 01-17-2003, 10:50 PM

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