Thread: Thread creation

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    2

    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
    Location
    The edge of the known universe
    Posts
    39,660
    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
    Posts
    8,895
    Not yet, anyway.

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

    "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
    Location
    Ireland
    Posts
    2,273
    Assuming windows: http://www.adrianxw.dk/SoftwareSite/index.html 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