Object Argument passing in pthread_create

Discussion in 'C++' started by nightowl, Oct 21, 2004.

  1. nightowl

    nightowl Guest

    Does anybodu know how to do it precisely
     
    nightowl, Oct 21, 2004
    #1
    1. Advertising

  2. nightowl

    Ron Natalie Guest

    nightowl wrote:
    > Does anybodu know how to do it precisely
    >

    pthread_create only handles a single void* arg. If it's
    that size or smaller, you can reinterpret_cast it on both
    sides. If it's larger, you'll have to allocate an object
    somewhere that's visible to the child thread and pass a
    pointer (casting it back in the thread function).
     
    Ron Natalie, Oct 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vertigo

    pthread_create for class ?

    vertigo, Aug 28, 2004, in forum: Java
    Replies:
    4
    Views:
    973
    Tor Iver Wilhelmsen
    Aug 29, 2004
  2. yezi

    What is the problem with Pthread_create

    yezi, Nov 1, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,060
    Emmanuel Delahaye
    Nov 1, 2005
  3. Replies:
    12
    Views:
    1,978
    verec
    Jul 17, 2005
  4. Gary Wessle

    pthread_create error

    Gary Wessle, Oct 21, 2006, in forum: C++
    Replies:
    9
    Views:
    1,040
    Larry Smith
    Oct 21, 2006
  5. Joy
    Replies:
    1
    Views:
    2,883
    Bart van Ingen Schenau
    May 27, 2009
Loading...

Share This Page