Re: possible typo in multithreading website
On Apr 13, 5:59 am, Jerry Coffin <jcof...@taeus.com> wrote:
In article <86b97279-97d4-409d-9ac8-566cae5dffe9
@g36g2000vbi.googlegroups.com>, Comp1...@yahoo.co.uk says...
[ ... ]
Thanks. The quoted article is from paulbridger.net and it
claims to teach c++ multithreading to a relative newbie
(obviously a total newbie wouldn't be learning
multithreading.) Anyway, I believe that I'm an ideal reader
for that site. And it wasn't (and isn't) apparent why void
pointers are needed in the above code segment. Could anyone
guide me to a good free e-resource on c++ multithreading
that explains these things better?
It uses pointers to void so you can actually pass a pointer to
some arbitrary data. Likewise, the return value allows
returning some arbitrary data of your choice.
That's the motivation for the additional pointer in the API. In
the posted code, the reason for the pointer was simply that the
API requires it in the signature of the function.
Just as it requires the function to be extern "C", so there was
an error in the example code:-).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34