multi-threaded under xHarbour

multi-threaded under xHarbour

Postby Natter » Thu Feb 25, 2016 10:36 am

Work under xHarbour functions are multi-threaded such as StartThread() / StopThread() ?
Natter
 
Posts: 1195
Joined: Mon May 14, 2007 9:49 am

Re: multi-threaded under xHarbour

Postby Enrico Maria Giordano » Thu Feb 25, 2016 5:29 pm

xHarbour seems to support multithread. What do you want to know exactly?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: multi-threaded under xHarbour

Postby Natter » Thu Feb 25, 2016 7:49 pm

Want to learn how you can create a new thread (with the function StartThread() failed)
Natter
 
Posts: 1195
Joined: Mon May 14, 2007 9:49 am

Re: multi-threaded under xHarbour

Postby Enrico Maria Giordano » Thu Feb 25, 2016 8:39 pm

Do you get any error messages?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: multi-threaded under xHarbour

Postby Natter » Thu Feb 25, 2016 9:26 pm

I don't get errors, just nothing happens.
I tried to run the examples with StartThread(), but instead of thread handle this function returns empty.
for example:

PROCEDURE Main
LOCAL pThread

CLS
USE Customer
pThread := StartThread( "ShowTime", 0, MaxCol()-7 )

Browse()

StopThread( pThread )

WaitForThreads()
RETURN

PROCEDURE ShowTime( nRow, nCol )
DO WHILE .T.
DispOutAt( nRow, nCol, Time() )
ThreadSleep( 1000 )
ENDDO
RETURN
Natter
 
Posts: 1195
Joined: Mon May 14, 2007 9:49 am

Re: multi-threaded under xHarbour

Postby Enrico Maria Giordano » Fri Feb 26, 2016 9:54 am

Just tried: works fine here.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: multi-threaded under xHarbour

Postby Enrico Maria Giordano » Fri Feb 26, 2016 11:39 am

Some details:

- I'm using latest xHarbour from SVN and BCC 7.10
- I had to link cw32mt.lib and vmmt.lib

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: multi-threaded under xHarbour

Postby Natter » Fri Feb 26, 2016 12:07 pm

Hm.. similarly, but does not work. I will think

Enrico, thank for your help !
Natter
 
Posts: 1195
Joined: Mon May 14, 2007 9:49 am

Re: multi-threaded under xHarbour

Postby Enrico Maria Giordano » Fri Feb 26, 2016 12:29 pm

Please try adding

Code: Select all  Expand view
SETMODE( 25, 80 )


at the start of your sample.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8696
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: multi-threaded under xHarbour

Postby Natter » Sun Feb 28, 2016 7:54 pm

I create a thread th:=Startthread() and open DIALOG . After doing the main thread I close my thead StopThread(th) or KillThread(th). But apparently the DIALOG in the thread is not closed and when you try to create a thread I get the error WINDOWS
Natter
 
Posts: 1195
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: TimStone and 39 guests