English
Forum

Hintergrundprozesse, how correct?

 

Clemens
Meier
i'm presently at a Internetanwendung dran, with the defined pieces too base64 kodiert/dekodiert go must. the code need always its Time, particularly with large Files. means would like I these Kodierung in the background run, so that the Hauptprogramm without trouble weiterlaufen can. therefore I will gladly a Hintergrundprozess started.

The following Szenarium:
I have a master.exe , one with XProfan compiliertes Piece Program
then have I a base64.prc . The communication between both should via pipe.pcu come off.
at that terminate of master.exe should too the Hintergrundprozess exits go (not that the thing as corpse in memory remaining).

to my knowledge, can I the base64.prc as Parameter of master.exe started. and I no Window generiere, appear it too nirgendwo, not more than in the Taskmanager as Process. correctly.? Starte I it on the best with WinExec ... ? there I get a handle back and could with Destroy(&handle) whom Process again stop. too correctly.?

I have here in the Forum but too others Opportunities found. though watts there only each a .exe launched, always without Parameter. then watts in another Thread erwähnt, that it under Win9X the Call several Profanprogramme at the same time To crash lead. unfortunately watts The Discussion there not To end led, so I do not white, whether it for a Workaround gives.

and letztes: presumably becomes The base64.prc not the only Process stay. Gäbe it Problems, if it several go?

Greeting
 
XProfan 9.1; XP SP2; FF; Editpad
05/22/06  
 



Hm here habs time zusammengepinselt, the ought to for a first orientation suffice:
CompileMarkSeparation
 {$cleq}
def $apptitle ClemensVorlage
cls
 $U pipe.pcu = pipe.
 $U thread.pcu = thread.
declare pipe&

if %parcount

    encode

else

    declare ex&
    app

endif

pipe.close pipe&
end

proc app

    print app
    case pipe.is(myClemensPipe) : error Pipe already exists, abort.
    pipe&:=pipe.create(myClemensPipe)
    declare fle$
    fle$:=dfokk.bmp
    casenot fileexists(fle$) : error File +fle$+ doesnt exist, abort.
    pipe.push pipe&,>+fle$
    shell par$(0)+ -
    thread.start 1,3
    usermessages 1

    whilenot ex&

        waitinput

    wend

    thread.stop 1
    print Tjoar fertig :P [taste]
    waitkey

endproc

proc encode

    print encoder
    casenot pipe.is(myClemensPipe) : error Pipe doesnt exists, abort.
    pipe&:=pipe.create(myClemensPipe)
    declare fle$
    fle$:=del$(pipe.pop(pipe&),1,1)
    casenot fileexists(fle$) : error File +fle$+ doesnt exist, abort.
    declare mem#,siz&
    siz&:=filesize(fle$)
    casenot siz& : error File +fle$+ is without content.
    print File: +fle$
    dim mem#,siz&
    blockread(fle$,mem#,0,siz&)
    declare i&,s$,c&
    for i&:=0 to siz& do begin
    c&+
    s$:=s$+.hexx(byte(mem#,i&))

    if c&>=512

        c&:=0
        pipe.push pipe&,<+s$
        s$:=

    endif

    end
    case len(s$) : pipe.push pipe&,<+s$
    pipe.push pipe&,.//bye

    proc .hexx

        parameters b&
        case b&<16 : return 0+hex$(b&)
        return hex$(b&)

    endproc

endproc

proc thread.do

    parameters n&
    declare s$
    s$:=mid$(pipe.get(pipe&),1,1)

    if n&==1

        if (s$==<)

            print pipe.pop(pipe&)

        elseif (s$==.)

            print done.
            ex&+
            sendmessage(%hwnd,1,0,0)

        endif

    endif

endproc

proc error

    parameters s$
    messagebox s$,$apptitle,0
    end

endproc

the demonstration shows too, the You sehrwohl too mehere processes beauftragen can, You you then but too one own log create must around the Inputs To koordinieren.
 
05/22/06  
 




Clemens
Meier
That the Pipe is me clear and a Threadid is for the Protokol with the eigenständigen Prozessen reserved. These processes should permanent in the background walk. Via Pipe and a handle per Process verläuft The communication. still what's the score with the Prozessen self. gives it Problems, if I whom Process as stated above aufrufe, means several Profaninstanzen in memory have.

or should I sooner on a appeal How under [...]  building? there becomes but only a exe called. i will but not different exe offer, separate possible as umbenannte prc-Files,

means: my Hauptprogramm is Program.exe
in this Program go two processes launched
the a hieß prozess1.prc and was before umbenannt To p1.ttt. this should with
Program.exe p1.ttt launched go
the second hieß prozess2.prc and was before umbenannt To p2.ttt. this should then with
Program.exe p2.ttt launched go.
both processes having no own Window, there's means too no Fehlermeldungen or Messages. everything becomes via Protokol on the Hauptprogramm gemeldet, so that this hereon react can, if necessary.

Gäbe it so Problems? which take action is for Calling the PRC-Files recommend? I hope, my trouble is now clear become (nevertheless thanks iF)
 
XProfan 9.1; XP SP2; FF; Editpad
05/22/06  
 




gives it Problems, if I whom Process as stated above aufrufe, means several Profaninstanzen in memory have.


blanket No.


Gäbe it so Problems?


blanket No.


or should I sooner on a appeal How under...


standing you spare.


which take action is for Calling the PRC-Files recommend?


See Source.

PS: its unwichtig How your Exen heissen, and wieviele exen (or prcs) You erstellst, and wieviele processes walk. my Source supra demonstrating: an Exe, two processes, One Source.
 
05/22/06  
 




Clemens
Meier
my trouble was well, I the Thread [...]  red have (System or Programmabsturz, if several Profanprogramme walk). But if You me now erklärst, that it there utterly no Problems gives, alike which method I use, I will you the first once believe. but blow, some win95 / 98 User tear me whom head ex, then visit I you
 
XProfan 9.1; XP SP2; FF; Editpad
05/23/06  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.053 Views

Untitledvor 0 min.
Sven Bader08/02/21
Jochen Roxlau03/24/15
Gary1234502/06/13
Pedro Miguel10/20/12
More...

Themeninformationen

this Topic has 2 subscriber:

Clemens Meier (3x)
iF (2x)


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