Commande de compilation...
Commande d'exécution...
Fichiers sources...
upscmp Source=demande
upscmp Source=serveur
upscmp Source=client
upsorb PortUpsOrb=1632
serveur PortUpsOrb=1632 PortServeur=1640 NbServeurs=1
client PortUpsOrb=1632 PortServeur=1650 NbServeurs=1
Source Module "Exemple d'emploi de la mémoire partagée" Version
1.0.0 ModuleDynamique;
Composant Dans "c:/up/exemples/libd1.upl";
Source Composant "Exemple d'emploi de la memoire protegee" Version
1.0.0 RattacherA "c:/up/exemples/demande.upl";
SegmentPublic MemoirePublique;
Public :
Type DemandeClient Defaut
/***********************/
Constructeur();
TacheClient : Nul Ou Tache;
Libelle : Nul Ou Caractere;
Fin Type
Variable
/******/
Public :
ListeDeDemandes : Nul Ou ListeDe DemandeClient;
SD : Nul Ou Synchronisation;
DebuterComposant
/**************/
Debut
Si SegmentPublic.NbUtilisations()==1 Alors
SD=Synchronisation("DemandeClient"<.I>, SynchronisationProtegee);
Fin Si
Fin DebuterComposant
Source Composant "Exemple d'emploi de la memoire protegee" Version
1.0.0;
SegmentPublic MemoireProtegee;
ImporterModule LibD(<libd.upi>, ImporterDefinitions);
Principal
/*******/
Variable
D : Nul Ou DemandeClient;
Debut
TantQue Vrai Faire
SD.Prendre(SynchronisationEcritureExclusive);
Si ListeDeDemandes!=Nul Alors
Pour D=ListeDeDemandes.ParcoursAuDebut() JusquA ListeDeDemandes.DernierElement()
Faire
D.Libelle=D.Libelle.Majuscule();
D.TacheClient.ReprendreTache();
Fin Pour
ListeDeDemandes=Nul;
Fin Si
SD.Lacher();
Attendre(1);
Fin TantQue
Fin Principal
Source Composant "Exemple d'emploi de la mémoire partagée" Version
1.0.0;
SegmentPublic MemoireProtegee;
ImporterModule LibD(<libd.upi>, ImporterDefinitions);
Procedure Dialoguer(Libelle : Caractere)
/************************************/
Variable
D : Nul Ou DemandeClient;
Debut
SD.Prendre(SynchronisationEcritureExclusive);
D=DemandeClient();
D.TacheClient=TachePrincipale;
D.Libelle=Libelle;
ListeDeDemandes=ListeDeDemandes+D;
SD.Lacher();
TachePrincipale.SuspendreTache();
Ecran.Ecrire(D.Libelle);
Fin Procedure
Principal
/*******/
Debut
Dialoguer("Bonjour le monde");
Attendre(1);
Dialoguer("Hello the world");
Attendre(1);
Dialoguer("Guten tag die welt");
Fin Principal