Thread: Thread creation

  1. #1
    Registered User
    Join Date
    Jan 2007

    Thread creation

    Can anyone share a piece of sample code for creating a process which inturns create a thread ?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Well that rather depends on which OS and compiler you're using.
    Standard C++ has no such notions.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Not yet, anyway.

    boost::thread t(threadproc);
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Assuming windows: Look at the bottom of the page. There are three tutorials. They're very straightforward to follow, but also, as far as I know, very basic.

    EDIT: Just read the title of your post. Not sure if this is what you're looking for.
    Haha. My post count says I'm leet
    Last edited by twomers; 01-06-2007 at 08:02 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Object Creation in thread function
    By sl4nted in forum Windows Programming
    Replies: 18
    Last Post: 10-11-2008, 02:37 PM
  2. Thread Prog in C language (seg fault)
    By kumars in forum C Programming
    Replies: 22
    Last Post: 10-09-2008, 01:17 PM
  3. CreateThread ?!
    By Devil Panther in forum Windows Programming
    Replies: 13
    Last Post: 11-15-2005, 10:55 AM
  4. pointer to main thread from worker thread?
    By draegon in forum C++ Programming
    Replies: 2
    Last Post: 10-27-2005, 06:35 AM
  5. Critical Sections, destroying
    By Hunter2 in forum Windows Programming
    Replies: 4
    Last Post: 09-02-2003, 10:36 PM