TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jim Louvau
from: Neil Spring
date: 1994-08-10 22:16:12
subject: C++ / threads

jl> the basic idea... the only real problem is that _beginthread() 
  jl> and DosCreateThread() are both want the thread function to be 'C'
  jl> and won't take a class-member method as a paramater... so you've 
  jl> got to fake 'em out by passing a static member or using an 
  jl> external 'C' helper function. I asked around in the C++ echo a 
  jl> while back, and the former method (using a static member) was by 
  jl> far the most popular solution... FWIW. 
 
that's what I was looking for... My code at the moment uses a friend
function that is passed a pointer to the class it's dealing with.  I'm not
sure if this will work.  even though it doesn't apply in my program, would
the static member solution be able to work in multiple sessions? i.e. each
class might start it's own instance of a calculation thread.  
 
BTW, what's the difference between DosCreateThread and _beginthread? I
always use DosCreateThread(), I don't know why.

--- Maximus/2 2.01wb


* Origin: OS/2 Connection {at} Mira Mesa, CA (1:202/354)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 413 430
SEEN-BY: 711/807 808 809 934 712/353 623 713/888 800/1
@PATH: 202/354 301 1 209/710 209 280/1 396/1 3615/50 259/98
@PATH: 250/99 801 229/2 12/2442 711/409 54/54 711/808 809 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™.