TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Schuller
from: Klaus Mahlmann
date: 1997-04-01 00:19:32
subject: Multithreading member-functions

Hallo Peter!

Am 28.03.97 schrieb Peter Schuller folgendes zum Thema "Multithreading
member-functions" an All:

 PS> Is there any way to multithread a C++ Class member-function? I'm using 
 PS> VisualAge C++ 3.0, and I am trying to execute a member-function in a
 PS> separate  thread. But the compiler says "error EDC3167: The
 PS> "_Optlink" qualifier cannot  be applied to
"void()".".

Generally speaking, functions which have to be called by the OS have to be
of a different calling type than C++ memeber functions. No way to mix the
two, AFAIK.

 PS> If I however move the function out of the class that  works, 
 PS> but instead I can't pass *this on to it.

Why not? Of course, you don't have the implicit "this" pointer.
But you should be able to explicitely pass any piece of data you want to
your C-type function, including a pointer to your class instance. This
should work for you - or am I missing anything?

Hope this helps,

Klaus

Disclaimer: The opinions expressed are solely those of the author.
            And are most probably wrong anyway.

--- FleetStreet 1.18+
* Origin: Paradatec (2:241/550.40)
SEEN-BY: 50/99 54/99 270/101 620/243 625/155 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 241/550 500 1000 2448/600 24/888 396/1 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.