Diff for /rpl/src/analyse.c between versions 1.82 and 1.113

version 1.82, 2013/03/20 17:11:43 version 1.113, 2019/01/01 09:02:40
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.13    RPL/2 (R) version 4.1.30
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2019 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 323  initialisation_instructions(struct_proce Line 323  initialisation_instructions(struct_proce
     INSTRUCTION("EGV", instruction_egv);      INSTRUCTION("EGV", instruction_egv);
     INSTRUCTION("END", instruction_end);      INSTRUCTION("END", instruction_end);
     INSTRUCTION("ENG", instruction_eng);      INSTRUCTION("ENG", instruction_eng);
       INSTRUCTION("EQV", instruction_eqv);
     INSTRUCTION("EXP", instruction_exp);      INSTRUCTION("EXP", instruction_exp);
     INSTRUCTION("FC?", instruction_fc_test);      INSTRUCTION("FC?", instruction_fc_test);
     INSTRUCTION("FFT", instruction_fft);      INSTRUCTION("FFT", instruction_fft);
Line 513  initialisation_instructions(struct_proce Line 514  initialisation_instructions(struct_proce
     INSTRUCTION("RECV", instruction_recv);      INSTRUCTION("RECV", instruction_recv);
     INSTRUCTION("REGV", instruction_regv);      INSTRUCTION("REGV", instruction_regv);
     INSTRUCTION("REPL", instruction_repl);      INSTRUCTION("REPL", instruction_repl);
       INSTRUCTION("RGDL", instruction_rgdl);
       INSTRUCTION("RGDR", instruction_rgdr);
     INSTRUCTION("RNRM", instruction_rnrm);      INSTRUCTION("RNRM", instruction_rnrm);
     INSTRUCTION("ROLL", instruction_roll);      INSTRUCTION("ROLL", instruction_roll);
     //INSTRUCTION("ROOT")      //INSTRUCTION("ROOT")
Line 772  initialisation_instructions(struct_proce Line 775  initialisation_instructions(struct_proce
     INSTRUCTION("RCLSWI", instruction_rclswi);      INSTRUCTION("RCLSWI", instruction_rclswi);
     INSTRUCTION("RECALL", instruction_recall);      INSTRUCTION("RECALL", instruction_recall);
     INSTRUCTION("RECODE", instruction_recode);      INSTRUCTION("RECODE", instruction_recode);
       INSTRUCTION("RECORD", instruction_record);
     INSTRUCTION("REDRAW", instruction_redraw);      INSTRUCTION("REDRAW", instruction_redraw);
     INSTRUCTION("REMOVE", instruction_remove);      INSTRUCTION("REMOVE", instruction_remove);
     INSTRUCTION("REPEAT", instruction_repeat);      INSTRUCTION("REPEAT", instruction_repeat);
Line 822  initialisation_instructions(struct_proce Line 826  initialisation_instructions(struct_proce
     INSTRUCTION("INQUIRE", instruction_inquire);      INSTRUCTION("INQUIRE", instruction_inquire);
     INSTRUCTION("MEMLOCK", instruction_memlock);      INSTRUCTION("MEMLOCK", instruction_memlock);
     INSTRUCTION("MTXLOCK", instruction_mtxlock);      INSTRUCTION("MTXLOCK", instruction_mtxlock);
       INSTRUCTION("NBRCPUS", instruction_nbrcpus);
     INSTRUCTION("PERSIST", instruction_persist);      INSTRUCTION("PERSIST", instruction_persist);
     INSTRUCTION("PLOTTER", instruction_plotter);      INSTRUCTION("PLOTTER", instruction_plotter);
     INSTRUCTION("PRIVATE", instruction_private);      INSTRUCTION("PRIVATE", instruction_private);
Line 842  initialisation_instructions(struct_proce Line 847  initialisation_instructions(struct_proce
   
     INSTRUCTION("CLRCNTXT", instruction_clrcntxt);      INSTRUCTION("CLRCNTXT", instruction_clrcntxt);
     INSTRUCTION("CLRSMPHR", instruction_clrsmphr);      INSTRUCTION("CLRSMPHR", instruction_clrsmphr);
       INSTRUCTION("COMPRESS", instruction_compress);
     INSTRUCTION("CONTINUE", instruction_continue);      INSTRUCTION("CONTINUE", instruction_continue);
     INSTRUCTION("CRITICAL", instruction_critical);      INSTRUCTION("CRITICAL", instruction_critical);
     INSTRUCTION("DUPCNTXT", instruction_dupcntxt);      INSTRUCTION("DUPCNTXT", instruction_dupcntxt);
Line 901  initialisation_instructions(struct_proce Line 907  initialisation_instructions(struct_proce
     //pentes      //pentes
     //représentent la valeur de la fonction (x,y) en leur milieu.      //représentent la valeur de la fonction (x,y) en leur milieu.
     //=> utile pour y'=F(x,y)      //=> utile pour y'=F(x,y)
       INSTRUCTION("UNCOMPRESS", instruction_uncompress);
   
     INSTRUCTION("LOCALIZATION", instruction_localization);      INSTRUCTION("LOCALIZATION", instruction_localization);
     INSTRUCTION("SMPHRTRYDECR", instruction_smphrtrydecr);      INSTRUCTION("SMPHRTRYDECR", instruction_smphrtrydecr);
Line 962  analyse_instruction(struct_processus *s_ Line 969  analyse_instruction(struct_processus *s_
 void  void
 analyse(struct_processus *s_etat_processus, void (*fonction)())  analyse(struct_processus *s_etat_processus, void (*fonction)())
 {  {
     static logical1                 initialisation = d_faux;  
   
     real8                           attente;      real8                           attente;
     real8                           pourcentage;      real8                           pourcentage;
     real8                           temps_cpu;      real8                           temps_cpu;
Line 1159  analyse(struct_processus *s_etat_process Line 1164  analyse(struct_processus *s_etat_process
     {      {
         if ((*s_etat_processus).test_instruction == 'N')          if ((*s_etat_processus).test_instruction == 'N')
         {          {
             if ((*s_etat_processus).nombre_interruptions_non_affectees != 0)              if (pthread_mutex_lock(&(*s_etat_processus).mutex_interruptions)
                       != 0)
             {              {
                 affectation_interruptions_logicielles(s_etat_processus);                  (*s_etat_processus).erreur_systeme = d_es_processus;
               }
               else
               {
                   if ((*s_etat_processus).nombre_interruptions_non_affectees != 0)
                   {
                       affectation_interruptions_logicielles(s_etat_processus);
                   }
   
                   if (pthread_mutex_unlock(&(*s_etat_processus)
                           .mutex_interruptions) != 0)
                   {
                       (*s_etat_processus).erreur_systeme = d_es_processus;
                   }
             }              }
   
             if (((*s_etat_processus).nombre_interruptions_en_queue != 0) &&              if (((*s_etat_processus).nombre_interruptions_en_queue != 0) &&
Line 1194  analyse(struct_processus *s_etat_process Line 1213  analyse(struct_processus *s_etat_process
   
         gettimeofday(&horodatage_final, NULL);          gettimeofday(&horodatage_final, NULL);
   
         if (initialisation == d_vrai)          if ((*s_etat_processus).initialisation_scheduler == d_vrai)
         {          {
             temps_reel = ((real8) (horodatage_final.tv_sec -              temps_reel = ((real8) (horodatage_final.tv_sec -
                     horodatage_initial.tv_sec)) +                      horodatage_initial.tv_sec)) +
Line 1232  analyse(struct_processus *s_etat_process Line 1251  analyse(struct_processus *s_etat_process
                             (*s_etat_processus).pourcentage_maximal_cpu)                              (*s_etat_processus).pourcentage_maximal_cpu)
                             - (pourcentage * temps_cpu / 100);                              - (pourcentage * temps_cpu / 100);
   
                     temporisation.tv_sec = (__time_t) floor(attente);                      temporisation.tv_sec = (time_t) floor(attente);
                     temporisation.tv_nsec = (__suseconds_t) ((attente                      temporisation.tv_nsec = (suseconds_t) ((attente
                             - ((real8) temporisation.tv_sec)) * 1E9);                              - ((real8) temporisation.tv_sec)) * 1E9);
   
                     while(nanosleep(&temporisation, &temporisation) == -1)                      while(nanosleep(&temporisation, &temporisation) == -1)
Line 1251  analyse(struct_processus *s_etat_process Line 1270  analyse(struct_processus *s_etat_process
         }          }
         else          else
         {          {
             initialisation = d_vrai;              (*s_etat_processus).initialisation_scheduler = d_vrai;
   
             horodatage_initial = horodatage_final;              horodatage_initial = horodatage_final;
             usage_initial = usage_final;              usage_initial = usage_final;
Line 1259  analyse(struct_processus *s_etat_process Line 1278  analyse(struct_processus *s_etat_process
     }      }
     else      else
     {      {
         initialisation = d_faux;          (*s_etat_processus).initialisation_scheduler = d_faux;
     }      }
   
 /*  /*

Removed from v.1.82  
changed lines
  Added in v.1.113


CVSweb interface <joel.bertrand@systella.fr>