Thread: Creating a thread in a class - C++

  1. #1
    Registered User
    Join Date
    Jun 2009

    Creating a thread in a class - C++

    HI all,

    I need to create a thread of 2 functions belonging to a same class.Can any one help me write
    a class with 2 functions being threads?. Is there any predefined thread class from which i
    can inherit?
    Thanks in advance....

  2. #2
    Join Date
    Oct 2007
    Inside my computer
    Classes aren't special. Class member functions can also be executed in threads, but I take it you somehow want to make a member function of a class the start routine for a thread?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a Window Class
    By Dark_Phoenix in forum Windows Programming
    Replies: 2
    Last Post: 12-07-2008, 07:45 PM
  2. API Thread HEADACHE
    By WaterNut in forum Windows Programming
    Replies: 11
    Last Post: 01-16-2007, 10:10 AM
  3. Need help to build network class
    By weeb0 in forum C++ Programming
    Replies: 0
    Last Post: 02-01-2006, 11:33 AM
  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. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM