Fivewin multi-threading Support ?

Fivewin multi-threading Support ?

Postby Jimmy » Sat Feb 25, 2023 11:24 am

hi,

i have include this on Top of Main
Code: Select all  Expand view
  IF !hb_mtvm()
      MSGSTOP( "There is no support for multi-threading" )
      QUIT
   ENDIF

Image
so how to enable multi-threading support for Fivewin :?:

---

edit : found
hbmk2 test -mt

but how with *.MAK (BCC) or *.HBP (MSVC) :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Sun Feb 26, 2023 6:55 am

hi,

after searching for Sample using hb_threadStart() under Fivewin it seems me that Fivewin User does not know it :?:

as i understand you need enable "multi-threading" support using Option -mt with hbmk2
also mt=yes in *.HBC "should" work ...

---

in *.HBP for MSVC 64 Bit i saw in 1st line
Code: Select all  Expand view
-gui


now i have add
Code: Select all  Expand view
-gui -mt


and "pass" Check
Code: Select all  Expand view
  IF !hb_mtvm()
      MSGSTOP( "There is no support for multi-threading" )
      //      QUIT
   ENDIF

and can start a Thread :D
Code: Select all  Expand view
  hb_threadStart( @MyMsgInfo(), "Hello World" )

Image
but as you can see i fail in "my" new Method ... how to debug ... hm

---

now i know how with *.HBP and MSVC but how with *.MAK and BCC :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Sun Feb 26, 2023 6:59 am

Question :

are CLASSS DATA "visible" in Thread, call by hb_threadStart() "in" Method of CLASS, or i do i need to "pass" them as Parameter :?:
can i use @::aSource or @MYaSource (per reference) :?:


Code: Select all  Expand view
#define HB_THREAD_INHERIT_PUBLIC    1
#define HB_THREAD_INHERIT_PRIVATE   2
#define HB_THREAD_INHERIT_MEMVARS   3
#define HB_THREAD_MEMVARS_COPY      4

i know HB_THREAD_INHERIT_PUBLIC but what is the Difference to PRIVATE or MEMVAR :?:
what does MEMVARS_COPY mean :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Antonio Linares » Sun Feb 26, 2023 8:36 am

Dear Jimmy,

Please review FWH\samples\buildhmt.bat

FWH works properly using multi thread you can try it using FiveDBU.prg
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Fivewin multi-threading Support ?

Postby Jimmy » Sun Feb 26, 2023 10:02 am

hi Antonio,
Please review FWH\samples\buildhmt.bat

FWH works properly using multi thread you can try it using FiveDBU.prg

Ah, i have to use another *.BAT

OK and how with *.MAK which i use under 32 Bit OS :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Sun Feb 26, 2023 10:05 am

hi,

how to use
Code: Select all  Expand view
  hb_threadDetach( LEN( oSelf:aThread ) )                            // close thread handle
   hb_threadQuitRequest( LEN( oSelf:aThread ) )                       // terminate thread

i have to it on End of Function, which is called by hb_threadStart(), but both fail at that place
"how" to "close" a Thread before RETURN :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Sun Feb 26, 2023 10:25 am

hi,

i have try buildhmt.bat and it seems to be for 32 Bit :?:
Der Befehl "c:\bcc7\bin\bcc32" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
* Linking errors *


btw. c:\fwh64\samples\testmt02.prg
Error in Line 34
uTh5 not define

must be uTh1

---

still not know how to enable -mt using *.MAK and BCC ... :(
or is there another Way instead of *.MAK which hold all *.PRG of Project under 32 Bit OS :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Mon Feb 27, 2023 12:01 am

hi,

is nobody using -mt and *.MAK with BCC :?:

is there a "other" Way to use "a List of *.PRG" to compile under 32 Bit OS :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Jimmy » Mon Feb 27, 2023 5:41 am

got it :)

you need to change in *.MAK
Code: Select all  Expand view
  echo $(HBDIR)\lib\win\bcc\hbvm.lib + >> b32.bc
   echo $(BCDIR)\lib\cw32.lib + >> b32.bc

into (add mt in LIB Name)
Code: Select all  Expand view
  echo $(HBDIR)\lib\win\bcc\hbvmmt.lib + >> b32.bc
   echo $(BCDIR)\lib\cw32mt.lib + >> b32.bc

now you can use "mt LIB" for "multi-threading" support under Fivewin with *.MAK (BCC)

this is my *.MAK for BCC 32 Bit
Code: Select all  Expand view
HBDIR=c:\harbour
BCDIR=c:\BCC7
FWDIR=c:\fwh

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include;$(BCDIR)\include\windows
.path.C   = .\
.path.rc  = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG = \
DUALGRID.PRG \
TGRID.PRG    \
SHELLAPP.PRG \
HBEJECT.PRG  \
CODEPAGE.PRG \
IPHONE.PRG   \
PROPERTY.PRG \
EVERYTH.PRG  \
HB_FUNC.PRG

PROJECT    : DUALGRID.EXE

DUALGRID.exe  : $(PRG:.PRG=.OBJ) DUALGRID.res
   @echo off
   echo $(BCDIR)\lib\c0w32.obj + > b32.bc
   echo obj\DUALGRID.obj obj\TGRID.obj obj\HB_FUNC.obj obj\SHELLAPP.obj obj\HBEJECT.obj obj\CODEPAGE.obj obj\IPHONE.obj obj\PROPERTY.obj obj\EVERYTH.obj , + >> b32.bc
   echo DUALGRID.exe, + >> b32.bc
   echo DUALGRID.map, + >> b32.bc
   echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbrtl.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbvmmt.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\gtgui.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hblang.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbmacro.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbrdd.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\rddntx.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\rddcdx.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\rddfpt.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbsix.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbdebug.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbcommon.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbpp.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbwin.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbcpage.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbct.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbpcre.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbcplr.lib + >> b32.bc
   echo $(HBDIR)\lib\win\bcc\xhb.lib + >> b32.bc
   
   echo $(HBDIR)\lib\win\bcc\hbziparc.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbmzip.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbzlib.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\minizip.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\png.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbusrrdd.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbtip.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbzebra.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbcurl.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\libcurl.lib +  >> b32.bc
   echo $(HBDIR)\lib\win\bcc\hbxpp.lib +  >> b32.bc

   echo $(FWDIR)\lib\dolphin.lib +  >> b32.bc
   
   echo $(BCDIR)\lib\cw32mt.lib + >> b32.bc
   echo $(BCDIR)\lib\uuid.lib + >> b32.bc
   echo $(BCDIR)\lib\ws2_32.lib +  >> b32.bc
   echo $(BCDIR)\lib\psdk\gdiplus.lib +  >> b32.bc
   echo $(BCDIR)\lib\import32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\psapi.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\rasapi32.lib + >> b32.bc
   echo $(BCDIR)\lib\psdk\shell32.lib,  >> b32.bc

   IF EXIST DUALGRID.res echo DUALGRID.res >> b32.bc
   $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
   del b32.bc

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /L /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include;$(BCDIR)\include\windows

  $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.C.OBJ:
  echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
  echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
  $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
  del tmp

DUALGRID.res : DUALGRID.rc
  $(BCDIR)\bin\brc32.exe -r DUALGRID.rc


---

Question : should i make a new Thread for User about using Thread with Fivewin :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin multi-threading Support ?

Postby Antonio Linares » Mon Feb 27, 2023 9:15 am

Dear Jimmy,

Very good

as you want :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42068
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 34 guests