Thread: General Thread question

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    General Thread question

    Is it important to know/use threads when doing Windows programs?
    Can you give a (real) example where it's useful, and where you absolutely HAVE TO use it?

    <edit>Ooops, double post. Sorry! (Isn't it possible to delete your own posts?). Cprogramming.com has been acting weird the whole day... for me at least... The rest of the WWW seems to work fine...</edit>
    Last edited by Magos; 09-11-2002 at 10:40 AM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    If you have any calculations to do that take any length of time then without multithreading your application you run the risk of losing all responsiveness from your user interface until those calculations are over. After a while programming for windows you will find you use threads more and more. Yes they are well worth learning/knowing about. Sooner or later you will need them.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    The GUI part of a program is the primary thread in the application kernel process object. Thus, it can do one calculation at a time. You cannot enter a loop and still expect the program to draw lines and handle message queue.

    Worker threads allows you to do calculation on separate threads.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. General linking question
    By BrandonW in forum C Programming
    Replies: 5
    Last Post: 05-02-2007, 12:24 PM
  2. General question from a beginner to Windows C++ programming
    By Kontan in forum Windows Programming
    Replies: 1
    Last Post: 09-29-2006, 08:03 PM
  3. [code] Win32 Thread Object
    By Codeplug in forum Windows Programming
    Replies: 0
    Last Post: 06-03-2005, 03:55 PM
  4. How to make a thread sleep or std::recv timeout?
    By BrianK in forum Linux Programming
    Replies: 3
    Last Post: 02-26-2003, 10:27 PM
  5. general pointer & malloc question
    By jstn in forum C Programming
    Replies: 2
    Last Post: 05-14-2002, 09:51 AM