comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » 6.3 reactions?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: 6.3 reactions? [message #48674 is a reply to message #48556] Tue, 09 May 2006 10:30 Go to previous messageGo to previous message
codepod is currently offline  codepod
Messages: 19
Registered: March 2006
Junior Member
The following code gives an idea of how this can work. Note: This isn't
exact, but should outline how the IDL-IDL bridge is used.

Preconditions:
Assume you have a variable MyData that you want to use as input to a
time consuming routine called MyRoutine. If you ran this in an IDL
application, the application would block until processing is done.
However with the bridge you can have it process in the background. The
general structure of the code is the following:

oBridge = obj_new("IDL_IDLBridge") ; creates the child process

;; Put the data in the child process session. This creates
;; a variable called Data in the child process and copies the
;; value of MyData into it. This exchange uses shared memory
;; to transfer values, but the actual data memory is not shared
;; between each process. (2 copies exist).
oBridge->SetVar, "Data", MyData

;; Lauch background processing
oBridge->Execute, "result = MyRoutine( Data )", /nowait

;; This call returns immediately

;; At this point this work will execute in the background
;; process. At a later time you can check and see if the
;; task is completed
iStatus = oBridge->Status()
if(iStatus eq 2)then begin ;; execution is completed
Result = oBridge->GetVar("Result") ;; get the result
endif

;; When you are completed with the process, just destroy the object
obj_destroy, oBridge

This simple example shows a "polling" method to check when the task is
completed. The object also has a callback methodology which operates
similar to an event callback. It will call a routine you specify when
an action happens (command done, error signaled).

Hopefully this helps.

-CP
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLWAVE and starting a comment on a new line
Next Topic: Re: changing a datatype in a structure

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:12:10 PDT 2025

Total time taken to generate the page: 0.00507 seconds