La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process.

Présentations similaires


Présentation au sujet: "IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process."— Transcription de la présentation:

1 IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process. Each instantiation of an IDL_IDLBridge object corresponds to one such child process. Child processes are controlled by the parent IDL process - the IDL process that created the IDL_IDLBridge objects. IDL_IDLBridge objects support the following operations: Exchanging data between the parent IDL process and the child process by copying IDL variables between them using the SetVar and GetVar methods. Executing arbitrary IDL commands in the child process. In synchronous operation, the parent IDL session waits for the child to complete the specified task before continuing. In asynchronous operation, the parent IDL session does not wait, and the two processes run in parallel. Querying the current status of the child process while it asynchronously executes an IDL command. Registering a callback that is called when an asynchronous command finishes execution. Aborting a currently running asynchronous command in a child process. Using these facilities, one or more IDL_IDLBridge child processes can be used to perform work in parallel with each other and with the parent IDL process that starts them. It is important to realize that IDL_IDLBridge child processes do not inherit any state information from the parent IDL process. This means that the child process will not have access to data, compiled routines, system variables, or even the current working directory of the parent process.

2 IDL_IDL Bridge Objectif technique :
Permettre le contrôle de processus IDL fils synchrones ou asynchrones à partir d’un processus IDL père. Les opérations suivantes sont disponibles : L’échange de données entre le processus IDL père et les processus IDL fils par copie de variables. L’exécution de commandes IDL arbitraires dans un processus fils en mode synchrone ou asynchrone. L’interrogation de l’état d’un processus fils asynchrone. L’appel d’une routine de callback lorsqu’une commande asynchrone se termine. L’interruption d’une commande asynchrone dans un processus fils.

3 API IDL_IDLBridge Méthode Execute :
Obj->[IDL_IDLBridge::]Execute, IDLStmt [, /NOWAIT] Méthodes GetVar/SetVar : imgData = oBridge->GetVar('data') oBridge->SetVar, "image", mriImg oBridge->Execute, "TVSCL, image" IIMAGE, imgData Définition d’une routine de callback : IDL> o = OBJ_NEW(“IDL_IDLBRIDGE”, $ CALLBACK = “callbackRoutine”, $ USERDATA = data) PRO callbackRoutine, Status, Error, Objref [, Userdata]

4 Utilisation des sémaphores pour synchroniser les processus
IDL dispose d’un mécanisme de sémaphores permettant la synchronisation de processus. -Les sémaphores peuvent etre utilisés dans le contexte de multiples processus IDL afin de protéger ou de restreindre l’accès a certaines ressources telles que de la mémoire partagée. Quatre routines IDL sont dédiées à la gestions des sémaphores : SEM_DELETE, SEM_LOCK, SEM_RELEASE

5 Exemple d’utilisation des sémaphores
1. Création d’un sémaphore dans la session IDL 1 : status = SEM_CREATE('semaphore1') 2. Verrouillage de ce sémaphore dans IDL 1 : status = SEM_LOCK('semaphore1') (si le verrou a pu être posé, status vaut 1) 3. Création du même sémaphore dans la session IDL 2 : status = SEM_CREATE('semaphore1') 4. Verrouillage de ce sémaphore dans IDL 2 : status = SEM_LOCK('semaphore1') (comme le verrou est détenu par IDL 1, status vaut 0) 5. Déverrouillage du sémaphore dans IDL 1 : SEM_RELEASE, 'semaphore1' 6. Verrouillage du sémaphore dans IDL 2 : status = SEM_LOCK('semaphore1') (comme le verrou a été libéré IDL 1, status vaut 1) 7. Destruction de la référence au sémaphore dans IDL 2 : SEM_DELETE, 'semaphore1' 8. Destruction physique du sémaphore dans IDL 1 : SEM_DELETE, 'semaphore1'

6 IDL_IDL Bridge Exemples


Télécharger ppt "IDL_IDL bridge The IDL_IDLBridge object class allows an IDL session to create and control other IDL sessions, each of which runs as a separate process."

Présentations similaires


Annonces Google