Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Object Argument passing in pthread_create

Thread Tools

Object Argument passing in pthread_create

Posts: n/a
Does anybodu know how to do it precisely

Reply With Quote
Ron Natalie
Posts: n/a
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).

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread_create returns error code 11 Joy C++ 1 05-27-2009 07:14 PM
pthread_create error Gary Wessle C++ 9 10-21-2006 10:33 PM
What is the problem with Pthread_create yezi C Programming 5 11-01-2005 09:08 PM
How to pass a class-member function to pthread_create(....)? C++ 12 07-17-2005 09:12 PM
pthread_create for class ? vertigo Java 4 08-29-2004 03:41 PM