Joe wrote:
> > > I am looking for documentation on how to implement threads
> > with C++. My
> > > problem is that I call a function from a class via
> > pthread_create and
> > > pass a (void *)-pointer with parameters. But this pointer
> > points
> > > anywhere, but not to the structure I want...
> >
> >  would this pointer happen to be relative to a class/struct ?
> >
> >  Threads only understand C-style pointers (i.e. no 'this'
> > pointer).
> > you need to provide C-style interface functions, or pass a
> > struct
> > containing the 'this' and any other pointers you need to the
> > thread
> > startup func.
> >
>    hmm ...have you searched the pthreads site to see if there
> are some 'pointers' (no pun intended) to some C++ wrapper
> funtions? It is possible that someone has started work on a C++
> interface to the pthreads library, just like there are C++
> wrappers to GTK+ (gtk--). ????
> 
>    ->http://www.mit.edu:8001/people/proven/pthreads.html
> 
>    have you tried emailing someone listed on the pthreads web
> site to see if they can give you some more info on this?

You want want to take a look at www.ysl.org.  (I'm the principle
maintainer so I'm a bit biased, but others who have used the YSL's think
they are not too bad either).

Basically the YSL's are a growing set of C++ class libraries.  In there
are C++ wrappers for threads and semphores.  All classes work fine under
both win32 and linux.  you will need a very recent egcs to handle the
some of the template classes, but if nothing else you can get some ideas
on doing the thread stuff in C++ by looking at the code.

Regards,
Steve Roberts
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to