Is it possible to invoke pthread_create on a method?

Is it possible to invoke pthread_create on a method instead of a standalone function?
non-static member functions of C++ classes are not suitable as routines for thread routines.

However, if the thread creation function has a parameter for passing a void pointer (and pthread_create has such a parameter)

Then you:
1. use a public static member function OR a normal function.
2. Pass the address of the object you want to operator on as the void* parameter to the thread creation routine.

Note:
If you use a normal function you may have to make it a friend of the class you will be operating on.


I hope that all makes sense.
Topic archived. No new replies allowed.