UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2006-05-25 08:21 AM

enjoy
Member
Registered: 2005-03-13
Posts: 20

Re: threads in C++

Hi,


i wanted to bind member function with thread. something  like,

class A
{
   public:
                    mem_fun();
....
...
..
};
main()
{
A *aobj;

pthread_create(&id, &attr, aobj->mem_fun,NULL);
pthread_join(&id,NULL);

}

is it possible? is it meaningful? will it work as in C language?
if not so, tell me the solution

regards,
enjoy

Offline

#2 2006-05-28 03:36 PM

Uzume
Administrator
Registered: 2002-08-30
Posts: 186

Re: threads in C++

I do not know alot about POSIX threads (which you seem to be using), however, as far as I know it should work as most C code will work with little modification in C++.

Offline

#3 2006-07-05 07:19 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: threads in C++


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

Board footer

Powered by FluxBB