Windows Threads

This is a discussion on Windows Threads within the Windows Programming forums, part of the Platform Specific Boards category; This is a pretty simple little question about windows threads. If I have some code that looks like this: Code: ...

  1. #1
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986

    Windows Threads

    This is a pretty simple little question about windows threads. If I have some code that looks like this:

    Code:
    while (1)
    {
       hThread = CreateThread(..., pfnDoSomething, ...);
    }
    Will this keep creating an unlimited number of threads, all executing the code in pfnDoSomething()?

    Or, will it only create the thread once, and then all subsequent calls simply get a handle from it? (like CreateFile can open an existing file).

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    It'll keep creating new threads until it crashes I believe.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    Location
    Australia
    Posts
    986
    Hehe thanks, I figured that was the case but I didn't want to try it myself incase my computer crashed, so thanks FYB!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. LoadFromFile() causes Windows 98 to freeze?
    By MidnightlyCoder in forum Windows Programming
    Replies: 8
    Last Post: 03-17-2006, 01:23 PM
  2. Program works on Windows XP and 2000, not on 98 or ME
    By MidnightlyCoder in forum C++ Programming
    Replies: 7
    Last Post: 03-10-2006, 02:36 PM
  3. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  4. Windows Threads
    By IceBall in forum Windows Programming
    Replies: 2
    Last Post: 10-18-2003, 01:18 PM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

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