Thread: Busy program

  1. #1
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640

    Busy program

    Ok so if you have a program that calculates alot of stuff at once, then sometimes the dialog messes up (the whole thing is white 'cept for toolbar). I'm thinking the best way to correct this is to put calculations in a new thread, is this a solution or is there a better way?
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Correct.

    One solution is multithreading.

    Kuphryn

  3. #3
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    thanks

    is there a way to close a thread within itself? like when the code is done in the thread, it can close itself?
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    When the threads function executes a return statement it will end. If you created the thread with beginthread() the threads handle will close automatically as well. If you used beginthreadex() you must close the handle yourself.

    There are also API functions for stopping threads, but that is usually enough.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Here is a nice thread class you can use (if using C++).

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM