M
mthread
Hi,
I am trying to create a thread by doing some thing like this.
class myclass
{
private :
.....
public :
void* My_function(void* voidPtr);
}
int main()
{
pthread_t tId;
myclass obj;
pthread_create(&tId, NULL, obj.My_function, NULL);
}
I get compilation error when i do this. I have a good experience in
multithreaded programming using C. But this is the first time I am
trying to do it in C++. I might be naive. I would like to know how I
can create a thread in C++(using C posix threads).
I am trying to create a thread by doing some thing like this.
class myclass
{
private :
.....
public :
void* My_function(void* voidPtr);
}
int main()
{
pthread_t tId;
myclass obj;
pthread_create(&tId, NULL, obj.My_function, NULL);
}
I get compilation error when i do this. I have a good experience in
multithreaded programming using C. But this is the first time I am
trying to do it in C++. I might be naive. I would like to know how I
can create a thread in C++(using C posix threads).