Creating a thread in a class - C++

This is a discussion on Creating a thread in a class - C++ within the Windows Programming forums, part of the Platform Specific Boards category; HI all, I need to create a thread of 2 functions belonging to a same class.Can any one help me ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    5

    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
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,443
    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, 06:45 PM
  2. API Thread HEADACHE
    By WaterNut in forum Windows Programming
    Replies: 11
    Last Post: 01-16-2007, 09:10 AM
  3. Need help to build network class
    By weeb0 in forum C++ Programming
    Replies: 0
    Last Post: 02-01-2006, 10: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, 09:27 PM
  5. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM

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