[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OO Threads (was RE: Learning C)



Interesting question.  I guess you'd have a function which would
instantiate the object and call its member funtion (method).  Of
course, the operating systems course I took was also procedurally
oriented so it is highly possible that I am missing something here,
too.  Just glad that I finally get to use something relevant to that
class!

Jack 

Adam Tauno Williams wrote:

I've been reading the pthreads book by O'Rielly to brush up on my
knowledge of threads, and I've got a question for all you OO (Object
Oriented) people.  And that's that threads make sense in a procedural
world, for example I do something like:
 
void fucntion1(int r1);
   int main() {
   pthread_t  thread1;
   int r1;
   pthread_create(thread1, NULL, (void*) function1, r1);
   ...
}
 
And the function I declared gets executed as the start of the thread.
I can't figure out/envision how this works in the OO model, and
O'Rielly doesn't really mention it.  Do I pass a pointed to a method
in an object?  Or in C++ can I pass a pointer to an object itself?

Systems and Network Administrator
Morrison Industries
1825 Monroe Ave NW.
Grand Rapids, MI. 49505