English
Forum

several Threads and Main-Program steer

 

p.specht

question: gives it there not Speicherlecks, if with the Closing-Cross aborted becomes instead of with ESC-Button?
 {$cleq}
cls
var n&=0
Print " Theads the row to with stop ESC-Button!"
var thread&=thread.start(procaddr(meinThread),0,"")
var thread2&=thread.start(procaddr(meinZweiterThread),0,"")

repeat

    locate 10,10:print n&:inc n&;
    waitinput 5

until %key=27

print "\n have Hauptschleife leave."
waitinput
thread.stop(thread&)

while thread.is(thread&)

endwhile

thread.close(thread&)
print " have Thread Nr. 1 exits."
waitinput
thread.stop(thread2&)

while thread.is(thread2&)

endwhile

thread.close(thread2&)
print " have Thread Nr. 2 exits."
print " Isch 'abe feddisch..."
waitinput 3000
end

nproc meinThread :parameters thread&,dataLong&,dataString$

    whilenot thread.message(thread&)==wm_close

        settext(%hWnd,"Mein FensterTitel - ["+time$(0)+"."+substr$(time$(1),1,".")+"]")
        sleep(1000)

    endwhile

    return 0

endproc

nproc meinZweiterThread :parameters thread&,dataLong&,dataString$

    whilenot thread.message(thread&)==wm_close

        settext(%hWnd,"MEIN FENSTERTI - ("+time$(0)+"."+substr$(time$(1),1,".")+")")
        sleep(900)

    endwhile

    return 0

endproc

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
03/13/14  
 




Nico
Madysa
Hello Peter,

I have me The freedom taken, your code from Lesbarkeitsgründen in [code]-Blöcke To settle. thereby have so did i a couple Doppelpunkte from your View source against Zeilenumbrüche swapped, because tappt im dunkeln whom seiteninternen Einrückungsparser confusion brought having.

what your question angeht, so have I earnest doubt, that there one Speicherleck existing. If you whom Closing-button press, becomes the XProfan-Window with DestroyWindow destroy and at end the Prozesses should too any Threads the Prozesses to that Erliegen come.

the are but everything only guesses. If you it very know want, can you Yes in a Loop the program a couple thousand time Call and it then one WM_CLOSE zukommen let, or. DestroyWindow on it utilize.

If itself not in the RAM-course your Taskmanagers noticeable power, is the thing probably sure.
 
03/14/14  
 




p.specht

thanks for rapid response, Nico! be on the testing...

The question related on these Note in the xpse-Funktionshilfe, wonach The function tread.is() fälschlicherweise always zero supply - otherwise could the Hauptprogramm remember and to wait it out, if yet Threads werken. knows there someone a work-around?
greeting

P.s.: with 'Mutex' to Synchronisation must I too first keep busy. a benefit to Polling see I presently sooner not. whom there apparently only Problemarten, The me bislang not yet untergekommen are.
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
03/17/14  
 




Nico
Madysa
If you no high Geschwindigkeiten need, would one Workaround, XProfan-Multiprozessing To use. this is slower, functions but at least.
next alternative would, with PExec a new Process to start, in the but against a Nproc aufzurufen. this is ugly, but the are Workarounds Yes usually.
 
03/17/14  
 



p.woodpecker (13.03.14)
question: gives it there not Speicherlecks, if with the Closing-Cross aborted becomes instead of with ESC-Button?


windows säubert (at least ex I faith) Version XP anyhow with Prozessende.

the Program had but Race-Condition-Problems if the Thread runs and hWnd talking without that it hWnd gives. Müsstest the good Order halber means to destruction the hWnd The Threads tidy terminate. accordingly becomes Window Style 512 well unavoidably.
 
07/10/14  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.288 Views

Untitledvor 0 min.
p.specht07/12/23
Walter04/01/20
Axel Berse09/24/19
E.T.12/26/18
More...

Themeninformationen

this Topic has 3 subscriber:

p.specht (2x)
Nico Madysa (2x)
iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie