Change the psud theme.
[hacks/simpleWebSlides.git] / unix_prog_web / unix_prog_web_02.xhtml
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
4           >
5 <html xmlns="http://www.w3.org/1999/xhtml" >
6   <head>
7     <title>Systèmes d'exploitation (2/2)</title>
8
9     <meta http-equiv="Content-Type"
10           content="text/html; charset=utf-8" />
11     <meta name="copyright"
12           content="Copyright &#169; 2013 Kim Nguyễn" />
13
14     <!-- Load jQuery -->
15     <script src="../jquery-1.9.1.min.js" type="text/javascript" ></script>
16     <!-- Load the library -->
17     <script src="../simpleWebSlides.js" type="text/javascript" ></script>
18
19     <link rel="stylesheet" href="../simpleWebSlides.css" type="text/css"  media="all" />
20     <!-- Load a custom Theme, the class-element marks this style-sheet
21          a "theme" that can be swtiched dynamicaly -->
22     <link class="sws-theme" rel="stylesheet"  title="U-Psud style"  href="../themes/uPsud.css" type="text/css" />
23
24     <!-- Customize some templates and initialize -->
25
26     <script type="text/javascript">
27       SWS.Config['sws-slide-change'] = SWS.Effects.slideChangeFadeOutIn;
28       SWS.Config['sws-object-deactivate'] =  SWS.Effects.objectDeactivateFadeOut;
29       SWS.Config['sws-object-activate'] = SWS.Effects.objectActivateFadeIn;
30
31       //Ensures that we load SWS at the very end, after MathJax has
32       //been initialized
33
34       $(window).load(SWS.Presentation.init);
35     </script>
36     <style>
37       #svg2,#svg3 {
38       -webkit-transform: scale(1.8) translateX(40%);
39       transform: scale(1.8) translateX(40%);
40       }
41     </style>
42   </head>
43   <body>
44     <a href="unix_prog_web_01.xhtml" class="sws-previous" />
45     <div class="sws-slide sws-cover sws-option-nofooter">
46       <h1>Unix et Programmation Web</h1>
47       <h1>Cours 2</h1>
48       <a href="mailto:kn@lri.fr">kn@lri.fr</a><br/>
49       <a href="http://www.lri.fr/~kn/">http://www.lri.fr/~kn</a>
50     </div>
51 <h1> Gestion des processus</h1>
52
53     <div class="sws-slide">
54       <h1> Définitions </h1>
55       <table class="desc">
56         <tr>
57           <td style="width:6.5em;">Programme</td> <td>séquences d'instructions effectuant
58             une tâche sur un ordinateur</td>
59         </tr>
60         <tr>
61           <td>Exécutable</td> <td>fichier binaire contenant des
62             instructions machines interprétables par le
63             microprocesseur</td>
64         </tr>
65         <tr>
66           <td><i>Thread</i> </td>
67           <td>plus petite unité de traitement (≡
68             séquence d'instructions) pouvant être ordonnancée par
69             l'OS
70           </td>
71         </tr>
72         <tr>
73           <td>Processus</td>
74           <td> instance d'un programme (≡ « un
75             programme en cours d'exécution »). Un processus est constitué
76             de un ou plusieurs <i>threads</i>.</td>
77         </tr>
78       </table>
79     </div>
80
81     <div class="sws-slide">
82       <h1> Exemple: programme </h1>
83       <p>Dans un fichier « <tt> counter.c </tt> »
84         (<span style="color:red;">attention c'est du pseudo
85           C</span>)</p>
86       <div style="float:left;clear:both;vertical-align:top;width:45%;display:inline-block;border-right: 1pt solid #494948;">
87 <code > int count = 0;
88  int exit = 0;
89  void <span style="color:green;">display()</span> {
90     while (exit == 0) {
91       sleep (3);
92       printf("%i\n", count);
93     }
94  }
95  void <span style="color:red;">listen()</span> {
96     while (exit == 0) {
97       wait_connect(80);
98       count++;
99   }
100  }</code>
101       </div> <div style="vertical-align:top;display:inline-block;width:45%;">
102 <code> void <span style="color:blue;">main ()</span> {
103     run_function(display);
104     run_function(listen);
105     while (getc () != '\n') { };
106     exit = 1;
107     return;
108  }</code>
109       </div>
110     </div>
111     <div class="sws-slide">
112       <h1> Exemple: programme </h1>
113       <p>Compilation <br/>
114         <code>
115           gcc -o counter.exe counter.c
116         </code><br/>
117         Le <em>fichier</em> « <tt>counter.exe</tt> » est un
118         exécutable (fichier binaire contenant du code machine)<br/>
119         <code>
120           ./counter.exe <span style="margin-left:2em;font-size:smaller;color:red;"> ← il faut la permission +x sur le fichier</span>
121         </code>
122         <br/>
123         Le contenu de l'exécutable est copié en mémoire et le processeur
124         commence à exécuter la première instruction du programme.
125       </p>
126     </div>
127     <div class="sws-slide">
128       <h1> Exemple: <i>threads</i> </h1>
129       <ol>
130         <li class="sws-pause" ><span style="color:white;background:blue">main</span> </li>
131         <li class="sws-pause" ><span style="color:blue;">attente d'un évènement clavier
132             →</span><span style="color:red;">←changement de <i>thread</i></span>
133         </li>
134         <li class="sws-pause" ><span style="color:white;background:red">listen</span> </li>
135         <li class="sws-pause" ><span style="color:red;">attente de connexion →</span><span style="color:green;">←changement de <i>thread</i></span>
136         </li>
137         <li class="sws-pause" ><span style="color:white;background:green">display</span> (<span style="color:green;">affiche
138             0 à l'écran)</span> </li>
139         <li class="sws-pause" ><span style="color:green;">attente pendant 3s →</span> (les
140           3 <i>threads</i> attendent un évènement externe)<br/>
141           <span class="sws-pause" >nouvelle connexion sur le port 80</span> <span style="color:red;">←
142             réveil du <i>thread</i> <code style="color:red;">listen</code></span>
143         </li>
144         <li class="sws-pause" ><span style="color:white;background:red">listen</span>
145           (<span style="color:red;">incrémente <tt style="color:red">count</tt></span>)<br/>
146           <span style="color:red;">attente de connexion →</span><br/>
147           <span>… fin des 3s</span><br/>
148           <span style="color:green;">←
149             réveil du <i>thread</i> <tt style="color:green;">display</tt></span>
150         </li>
151         <li class="sws-pause" ><span style="color:white;background:green">display</span> (<span style="color:green;">affiche
152             1 à l'écran)</span> </li>
153       </ol>
154       <p class="sws-pause" >Les <i>threads</i> partagent leur mémoire (variables communes)</p>
155     </div>
156     <div class="sws-slide">
157       <h1>Exemple: processus</h1>
158       <p>(différence: les processus
159         <em>ne partagent pas leur espace mémoire</em>)</p>
160       <ol>
161         <li>Exécution de <code><span style="color:blue;">coun</span><span style="color:red;">ter</span><span style="color:green;">.exe</span></code> pendant 50㎲
162         </li>
163         <li > Exécution
164           de <code><span style="color:orange;">firefox.exe</span></code>
165           pendant 50㎲ </li>
166         <li > Exécution du processus qui dessine le bureau pendant 50
167           ㎲<br/> … </li>
168
169       </ol>
170       <p>C'est le <em>gestionnaire de processus</em> qui décide quel
171         programme a la main et pour combien de temps (priorité aux
172         tâches critiques par exemple)<br/>
173         Le système d'exploitation stocke pour chaque processus un
174         ensemble d'informations, le PCB (<i>Process Control Block</i>).
175       </p>
176     </div>
177     <div class="sws-slide">
178       <h1>Proccess Control Block</h1>
179       <p>Le PCB contient:</p>
180       <ul>
181         <li>l'<em>identificateur du processus</em> (pid)</li>
182         <li>l'<em>l'état</em> du processus (en attente, en exécution,
183           bloqué, …)</li>
184         <li>le compteur d'instructions (<i>i.e.</i> où on en est dans
185           le programme)</li>
186         <li>le <em>contexte courant</em>(état des registres, …)</li>
187         <li>position dans <em>la file d'attente de priorité
188             globale</em></li>
189         <li>informations mémoire (zones allouées, zones accessibles,
190           zones partagées)</li>
191         <li>listes des fichiers ouverts (en lecture, en écriture),
192           liste des connexions ouvertes, … <br/> … </li>
193       </ul>
194     </div>
195     <div class="sws-slide">
196       <h1>Opérations sur les processus</h1>
197       <ul>
198         <li><em>création</em> et <em>destruction</em> de
199           processus</li>
200         <li><em>suspension</em> et <em>reprise</em></li>
201         <li><em>duplication</em> (<i>fork</i>)</li>
202         <li>modification de la <em>priorité</em></li>
203         <li>modification des <em>permissions </em></li>
204       </ul>
205     </div>
206     <div class="sws-slide">
207       <h1>États d'un processus</h1>
208       <p>Un processus change d'état au cours de son exécution</p>
209       <table class="desc">
210         <tr><td style="width:6em;">Nouveau</td> <td>le processus est en cours de création</td></tr>
211         <tr><td>Exécution</td> <td>le processus s'exécute</td></tr>
212         <tr><td>En attente</td> <td>le processus attend un évènement
213             particulier (saisie au clavier, écriture sur le disque,
214             …)</td></tr>
215         <tr><td>Prêt</td> <td>le processus est prêt à reprendre son
216             exécution et attend que l'OS lui rende la main</td></tr>
217         <tr><td>terminé</td> <td>le processus a fini son exécution</td></tr>
218       </table>
219     </div>
220     <div class="sws-slide">
221       <h1>États d'un processus</h1>
222       <p>L'OS détermine et modifie l'état d'un processus:</p>
223       <ul>
224         <li>En fonction d'évènements internes au processus:
225           <ul><li>lecture d'un fichier (si le contenu n'est pas
226               disponible, le processus passe de « prêt » à « en attente
227               »)</li>
228             <li>le processus attends volontairement pendant x
229               secondes<br/>…</li>
230           </ul>
231         </li>
232         <li>
233           En fonction d'évènements externes au processus:
234           <ul><li>un fichier devient disponible</li>
235             <li>un <i>timer</i> arrive à 0</li>
236             <li>le matériel déclenche une <em>interruption</em></li>
237           </ul>
238         </li>
239       </ul>
240     </div>
241     <div class="sws-slide">
242       <h1>États d'un processus</h1>
243       <svg
244          xmlns:svg="http://www.w3.org/2000/svg"
245          xmlns="http://www.w3.org/2000/svg"
246          version="1.1"
247          width="340.10629"
248          height="207.70399"
249          viewBox="0 0 350 208"
250          id="svg2"
251          >
252         <defs
253            id="defs4">
254           <marker
255              refX="0"
256              refY="0"
257              orient="auto"
258              id="Arrow2Mend"
259              style="overflow:visible">
260             <path
261                d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
262                transform="scale(-0.6,-0.6)"
263                id="path3842"
264                style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
265           </marker>
266         </defs>
267         <g
268            transform="translate(-43.8,-16.162183)"
269            id="layer1">
270           <g
271              transform="translate(2.8953552e-6,-2.2416992e-6)"
272              id="g4956">
273             <text
274                x="50"
275                y="32.362183"
276                id="text2985"
277                xml:space="preserve"
278                style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
279                                                                                                                                                                                                                                                                              x="50"
280                                                                                                                                                                                                                                                                              y="32.362183"
281                                                                                                                                                                                                                                                                              id="tspan2987">Nouveau</tspan></text>
282             <text
283                x="140"
284                y="102.36218"
285                id="text2989"
286                xml:space="preserve"
287                style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
288                                                                                                                                                                                                                                                                              x="140"
289                                                                                                                                                                                                                                                                              y="102.36218"
290                                                                                                                                                                                                                                                                              id="tspan2991">Prêt</tspan></text>
291             <text
292                x="255"
293                y="102.36218"
294                id="text2993"
295                xml:space="preserve"
296                style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
297                                                                                                                                                                                                                                                                              x="255"
298                                                                                                                                                                                                                                                                              y="102.36218"
299                                                                                                                                                                                                                                                                              id="tspan2995">En exécution</tspan></text>
300             <text
301                x="195"
302                y="187.36218"
303                id="text2997"
304                xml:space="preserve"
305                style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
306                                                                                                                                                                                                                                                                              x="195"
307                                                                                                                                                                                                                                                                              y="187.36218"
308                                                                                                                                                                                                                                                                              id="tspan2999">En attente</tspan></text>
309             <rect
310                width="65"
311                height="20"
312                rx="5"
313                ry="5.25"
314                x="45"
315                y="17.362183"
316                id="rect3007"
317                style="fill:none;stroke:#ffff05;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
318             <rect
319                width="45"
320                height="20"
321                rx="5"
322                ry="5.25"
323                x="130"
324                y="87.362183"
325                id="rect3007-2"
326                style="fill:none;stroke:#009eff;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
327             <rect
328                width="90"
329                height="20"
330                rx="5"
331                ry="5.25"
332                x="250"
333                y="87.362183"
334                id="rect3007-8"
335                style="fill:none;stroke:#5aff0b;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
336             <rect
337                width="68"
338                height="19"
339                rx="5"
340                ry="5.25"
341                x="192"
342                y="173.36218"
343                id="rect3007-7"
344                style="fill:none;stroke:#ff7b00;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
345             <path
346                d="m 70,42.362183 c 0,35 20,55 55,55"
347                id="path3809"
348                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
349             <path
350                d="m 150,82.362183 c 30,-30 120,-30 145,0"
351                id="path3809-2"
352                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
353             <path
354                d="m 295,112.36218 c -30,30 -121.15954,29.51126 -146.15954,-0.48874"
355                id="path3809-2-8"
356                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
357             <path
358                d="m 305,112.36218 c 0,35 -10,70 -45,70"
359                id="path3809-9"
360                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
361             <path
362                d="m 185,182.36218 c -35.00001,0 -45,-35 -45,-70"
363                id="path3809-9-6"
364                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
365             <text
366                x="325"
367                y="217.36218"
368                id="text2997-5"
369                xml:space="preserve"
370                style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
371                                                                                                                                                                                                                                                                              x="325"
372                                                                                                                                                                                                                                                                              y="217.36218"
373                                                                                                                                                                                                                                                                              id="tspan2999-3">Terminé</tspan></text>
374             <rect
375                width="58"
376                height="19"
377                rx="5"
378                ry="5.25"
379                x="322"
380                y="203.36218"
381                id="rect3007-7-6"
382                style="fill:none;stroke:#ff0000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
383             <path
384                d="m 315,112.36218 c 13.42024,11.32439 24.04764,43.74151 35,85"
385                id="path3809-9-6-7"
386                style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
387             <path
388                d="m 225,197.36218 c 15,15 60,15 95,15"
389                id="path3809-9-6-2"
390                style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:2, 1;stroke-dashoffset:0;marker-end:url(#Arrow2Mend)" />
391             <path
392                d="m 135,112.36218 c 5,85 20,100 185,105"
393                id="path3809-8"
394                style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:2, 1;stroke-dashoffset:0;marker-end:url(#Arrow2Mend)" />
395             <text
396                x="225"
397                y="37.362183"
398                id="text4821"
399                xml:space="preserve"
400                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
401                                                                                                                                                                                                                                                                                                                x="225"
402                                                                                                                                                                                                                                                                                                                y="37.362183"
403                                                                                                                                                                                                                                                                                                                id="tspan4823">mise en route</tspan><tspan
404                                                                                                                                                                                                                                                                                                                                                       x="225"
405                                                                                                                                                                                                                                                                                                                                                       y="48.612183"
406                                                                                                                                                                                                                                                                                                                                                       id="tspan4825">par l'ordonnanceur</tspan></text>
407             <text
408                x="220"
409                y="117.36218"
410                id="text4821-3"
411                xml:space="preserve"
412                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
413                                                                                                                                                                                                                                                                                                                x="220"
414                                                                                                                                                                                                                                                                                                                y="112.36218"
415                                                                                                                                                                                                                                                                                                                id="tspan4823-1">interruption</tspan><tspan
416                                                                                                                                                                                                                                                                                                                                                        x="220"
417                                                                                                                                                                                                                                                                                                                                                        y="123.61218"
418                                                                                                                                                                                                                                                                                                                                                        id="tspan4825-7">par l'ordonnanceur</tspan></text>
419             <text
420                x="300"
421                y="187.36218"
422                id="text4821-0"
423                xml:space="preserve"
424                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
425                                                                                                                                                                                                                                                                                                                x="300"
426                                                                                                                                                                                                                                                                                                                y="187.36218"
427                                                                                                                                                                                                                                                                                                                id="tspan4825-74">attente E/S</tspan><tspan
428                                                                                                                                                                                                                                                                                                                                                        x="300"
429                                                                                                                                                                                                                                                                                                                                                        y="198.61218"
430                                                                                                                                                                                                                                                                                                                                                        id="tspan4864">interruption</tspan></text>
431             <text
432                x="180"
433                y="152.36218"
434                id="text4821-0-2"
435                xml:space="preserve"
436                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
437                                                                                                                                                                                                                                                                                                                x="180"
438                                                                                                                                                                                                                                                                                                                y="152.36218"
439                                                                                                                                                                                                                                                                                                                id="tspan4864-7">fin E/S</tspan><tspan
440                                                                                                                                                                                                                                                                                                                                                   x="180"
441                                                                                                                                                                                                                                                                                                                                                   y="163.61218"
442                                                                                                                                                                                                                                                                                                                                                   id="tspan4892">int. traitée</tspan><tspan
443                                                                                                                                                                                                                                                                                                                                                                                         x="180"
444                                                                                                                                                                                                                                                                                                                                                                                         y="174.86218"
445                                                                                                                                                                                                                                                                                                                                                                                         id="tspan4894">…</tspan></text>
446             <text
447                x="360"
448                y="147.36218"
449                id="text4821-0-29"
450                xml:space="preserve"
451                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
452                                                                                                                                                                                                                                                                                                                x="365"
453                                                                                                                                                                                                                                                                                                                y="147.36218"
454                                                                                                                                                                                                                                                                                                                id="tspan4864-1">terminaison</tspan><tspan
455                                                                                                                                                                                                                                                                                                                                                       x="365"
456                                                                                                                                                                                                                                                                                                                                                       y="158.61218"
457                                                                                                                                                                                                                                                                                                                                                       id="tspan4909">normale</tspan></text>
458             <text
459                x="170"
460                y="212.36218"
461                id="text4821-0-7"
462                xml:space="preserve"
463                style="font-size:9px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
464                                                                                                                                                                                                                                                                                                                x="170"
465                                                                                                                                                                                                                                                                                                                y="212.36218"
466                                                                                                                                                                                                                                                                                                                id="tspan4864-75">terminaison</tspan><tspan
467                                                                                                                                                                                                                                                                                                                                                        x="170"
468                                                                                                                                                                                                                                                                                                                                                        y="223.61218"
469                                                                                                                                                                                                                                                                                                                                                        id="tspan4935">anormale</tspan></text>
470           </g>
471         </g>
472       </svg>
473     </div>
474     <div class="sws-slide">
475       <h1>La commande <code><em>ps</em></code></h1>
476       <p>Permet d'avoir des informations sur les processus en cours
477         d'exécution (voir « <tt>man ps</tt> » pour les
478         options):<br/>
479         <code>$ ps -o user,pid,state,cmd x
480           USER     PID   S CMD
481           …
482           kim      27030 Z [chrome] &lt;defunct&gt;
483           kim      27072 S /opt/google/chrome/chrome --type=renderer
484           kim      29146 S bash
485           kim      29834 S evince
486           kim      29858 S emacs cours.xhtml
487           kim      29869 R ps -o user,pid,state,cmd x
488         </code><br/>
489       </p>
490
491     </div>
492     <div class="sws-slide">
493       <h1>États des processus (sous Linux)</h1>
494       <table class="desc">
495         <tr> <td>R</td> <td> <i>Running</i> (en cours d'exécution)</td> </tr>
496         <tr> <td>S</td> <td> <i>Interruptible sleep</i> (en attente,
497             interruptible) </td> </tr>
498         <tr> <td>D</td> <td> <i>Uninterruptible sleep</i> (en attente,
499             non-interruptible) </td> </tr>
500         <tr> <td>T</td> <td> <i>Stopped</i> (interrompu)</td></tr>
501         <tr> <td>Z</td> <td> <i>Zombie</i> (terminé mais toujours
502             listé par le système)</td> </tr>
503       </table>
504     </div>
505
506     <div class="sws-slide">
507       <h1>Signaux</h1>
508       <p>L'OS peut envoyer des <em>signaux</em> à un processus. Sur réception
509         d'un signal, un processus peut interrompre son comportement normal
510         et exécuter son <em>gestionnaire de signal</em>. Quelques signaux:
511       </p>
512       <table class="simple">
513         <tr><th>Nom</th> <th>Code</th> <th>Description</th> </tr>
514         <tr><td>HUP</td> <td>1</td> <td>demande au processus de
515             s'interrompre</td></tr>
516         <tr><td>INT</td> <td>2</td> <td>demande au processus de se
517             terminer</td></tr>
518         <tr><td>ABRT</td> <td>2</td> <td>interrompt le processus et produit
519             un <i>dump</i></td></tr>
520         <tr><td>KILL</td> <td>9</td> <td>interrompt le processus immédiatement
521         </td></tr>
522         <tr><td>SEGV</td> <td>11</td> <td>signale au processus une erreur mémoire
523         </td></tr>
524         <tr><td>STOP</td> <td>24</td> <td>suspend l'exécution du processus
525         </td></tr>
526         <tr><td>CONT</td> <td>28</td> <td>reprend l'exécution d'un processus suspendu
527         </td></tr>
528       </table>
529     </div>
530     <div class="sws-slide">
531       <h1>Processus et terminal</h1>
532       <p >Un processus est lié au <em>terminal</em> dans lequel il est
533         lancé. Si on exécute un programme dans un terminal et que le
534         processus ne rend pas la main, le terminal est bloqué
535 <code >
536
537  $ gedit
538
539 </code>
540         On peut envoyer au processus le signal <em>STOP</em> en
541         tapant <code>ctrl-Z</code> dans le terminal:
542 <code>
543
544  $ gedit
545  ^Z
546  [1]+  Stopped            gedit
547
548 </code>
549         Le processus est suspendu, la fenêtre est gelée (ne répond plus).
550       </p>
551     </div>
552     <div class="sws-slide">
553       <h1>Processus et terminal</h1>
554       <p> <span>On peut reprendre l'exécution du programme de deux
555           manières:<br/>
556           <code> $ fg </code><br/>
557           Reprend l'exécution du processus et le remet en avant plan (terminal
558           bloqué)</span><br/>
559         <span class="sws-pause"><code> $ bg </code><br/>
560           Reprend l'exécution du processus et le remet en arrière plan (terminal
561 libre)</span><br/>
562         <span class="sws-pause">On peut lancer un programme
563           directement en arrière plan en faisant:<br/>
564 <code> $ gedit &amp; </code><br/></span>
565         <span class="sws-pause">On peut envoyer un signal à un
566           processus avec la commande «&nbsp;<tt>kill [-signal] pid</tt>&nbsp;»<br/>
567 <code> $ kill -9 2345  </code></span>
568         </p>
569         </div>
570     <div class="sws-slide">
571       <h1>Processus et entrées/sorties</h1>
572       <p>Le terminal et le processus sont liés par trois fichiers
573       spéciaux:</p>
574       <ol>
575         <li> L'entrée standard (<tt><em>stdin</em></tt>), reliée
576           au clavier</li>
577         <li> La sortie standard (<tt><em>stdout</em></tt>), reliée
578           à l'affichage</li>
579         <li> La sortie d'erreur (<tt><em>stderr</em></tt>), reliée
580           à l'affichage</li>
581       </ol>
582       <p>Dans le <i>shell</i>, on peut utiliser les
583       opérateurs <tt><em>&lt;</em></tt>, <tt><em>&gt;</em></tt>
584       et <tt><em>2&gt;</em></tt> pour récupérer le contenu
585       de <tt><em>stdin</em></tt>, <tt><em>stdout</em></tt>
586       et <tt><em>stderr</em></tt>:<br/>
587 <code>
588 $ sort &lt; toto.txt
589 $ ls -l  &gt; liste_fichiers.txt
590 $ ls -l * 2&gt; erreurs.txt
591 </code>
592 </p>
593 </div>
594     <div class="sws-slide">
595       <h1>Processus et entrées/sorties</h1>
596       <p>Dans le <i>shell</i>, l'opérateur <em>|</em> permet
597       d'enchaîner la sortie d'un programme avec l'entrée d'un
598       autre:<br/>
599 <code> $ <span style="color:green;">ls -l *.txt</span> | <span style="color:blue">sort -n -r -k 5</span> | <span style="color:orange">head -n 1</span></code>
600       </p>
601       <ol>
602         <li style="color:green;">affiche la liste détaillée des
603         fichiers textes</li>
604         <li style="color:blue;">trie (et affiche) l'entrée standard par ordre
605         numérique décroissant selon le 5ème champ</li>
606         <li style="color:orange;">affiche la première ligne de
607         l'entrée standard</li>
608       </ol>
609       <div style="height:5em;position:relative;margin:0 0;padding:0 0;">
610 <code class="sws-onframe-1" style="position:absolute;color:green;"> -rw-rw-r    1 kim kim 471 Sep 14 16:25 bd.txt
611  -rw-rw-r    1 kim kim 234 Sep 15 17:46 foo.txt
612  -rw-rw-r    1 kim kim 1048576 Sep 24 09:20 large.txt</code>
613 <code class="sws-onframe-2" style="position:absolute;color:blue;"> -rw-rw-r    1 kim kim 1048576 Sep 24 09:20 large.txt
614  -rw-rw-r    1 kim kim 471 Sep 14 16:25 bd.txt
615  -rw-rw-r    1 kim kim 234 Sep 15 17:46 foo.txt
616 </code>
617 <code class="sws-onframe-3" style="position:absolute;color:orange;"> -rw-rw-r    1 kim kim 1048576 Sep 24 09:20 large.txt
618 </code>
619       </div>
620
621     </div>
622
623 <h1>Écriture de script <i>shell</i></h1>
624 <div class="sws-slide">
625   <h1>Script shell</h1>
626   <p><a>Mentalité Unix</a> beaucoup de petits programmes spécifiques,
627   que l'on combine au moyen de scripts pour réaliser des actions
628   complexes. Exemple de fichier script:
629   </p>
630   <code style="background:white;">
631     <s>#!/bin/bash</s>
632
633     <s>for</s> i <s>in</s>  img_*.jpg
634     <s>do</s>
635       base=$(echo "$i" | cut -f 2- -d '_')
636       nouveau=photo_"$base"
637       <s>if</s> test -f "$nouveau"
638       <s>then</s>
639          echo "Attention, le fichier $nouveau existe déjà"
640          continue
641       <s>else</s>
642          echo "Renommage de $i en $nouveau"
643          mv "$i" "$nouveau"
644       <s>fi</s>
645     <s>done</s>
646   </code>
647 </div>
648 <div class="sws-slide">
649 <h1>Rendre un script exécutable</h1>
650 <p>Si un fichier <a>texte</a> (quel que soit son extension), commence
651   par les caractères <tt>#!/chemin/vers/un/programme</tt>, on peut
652   rendre ce fichier exécutable (<tt>chmod +x</tt>). Si on l'exécute,
653   le contenu du fichier est passé comme argument à <tt>programme</tt>
654   (qui est généralement un interpréteur)
655 </p>
656 <p><tt>#!/bin/bash</tt> signifie que le corps du fichier est passé au
657   programme <tt>bash</tt> qui est l'interprète de commande
658   (le <i>shell</i>).
659 </p>
660 </div>
661 <div class="sws-slide">
662 <h1>Que mettre dans un script</h1>
663 <ul>
664   <li> des commandes (comme si on les entrait dans le terminal)</li>
665   <li> des structures de contrôle (boucles <tt>for</tt>, <tt>if then
666   else</tt>) </li>
667   <li> des définitions de variables </li>
668 </ul>
669 </div>
670 <div class="sws-slide">
671 <h1>Définitions de variables</h1>
672 <p>On peut définir des variables au moyen de la notation
673 <code>VARIABLE=<i>contenu</i></code> et on peut utiliser la variable
674 avec la notation <tt>$VARIABLE</tt> </p>
675 <ul>
676   <li>Attention, pas d'espace autour du <tt>=</tt></li>
677   <li>nom de variable en majuscule ou minuscule</li>
678   <li>contenu est une chaine de caractères. Si elle contient des
679   espaces, utiliser <tt>" ... "</tt></li>
680 </ul>
681 <p>exemple de définition :</p>
682 <code>    i=123
683     j="Ma super chaine"
684     TOTO=titi
685     echo $TOTO
686 </code>
687 <p> exemple d'utilisation: <tt> echo $j $i $TOTO </tt><br/>
688 affiche « <tt> Ma super chaine 123 titi</tt></p>
689 </div>
690 <div class="sws-slide">
691 <h1>Boucles <tt>for</tt></h1>
692 <p>Les boucles <tt> for </tt> ont la syntaxe:
693 <code>
694     for VARIABLE in elem<sub>1</sub> ... elem<sub>n</sub>
695     do
696         ....
697     done
698 </code>
699 chaque <tt>elem<sub>i</sub></tt> est expansé (comme une ligne de
700 commande) avant l'évaluation de la boucle:
701 <code>
702   for i in *.txt
703   do
704      echo $i est un fichier texte
705   done
706 </code>
707 On peut quitter une boucle prématurément en utilisant <tt>break</tt>
708 et passer directement au tour suivant avec <tt>continue</tt>
709 </p>
710 </div>
711 <div class="sws-slide">
712 <h1>Conditionnelle</h1>
713 <p>La syntaxe est :
714 <code>   if <i>commande</i>
715    then
716         ...
717    else
718         ...
719    fi
720 </code>
721 <tt><i>commande</i></tt> est évaluée. Si elle se termine avec succès,
722 la branche <tt>then</tt> est prise. Si elle se termine avec un code
723 d'erreur, la branche <tt>else</tt> est prise. On peut utiliser la
724 commande <tt>test</tt> qui permet de tester plusieurs conditions
725 (existance d'un fichier, égalités de deux nombres, ...) et se termine
726 par un succès si le teste est vrai et par un code d'erreur dans le
727 cas contraire</p>
728 </div>
729 <div class="sws-slide">
730 <h1>Conditionnelle (exemple)</h1>
731 <p>On regarde tour à tour si fichier1.txt, fichier2.txt, ... existent :
732 <code>
733   for i in 1 2 3 4 5 6
734   do
735     if test -f "fichier$i".txt
736    then
737       echo le fichier "fichier$i".txt existe
738    fi
739   done
740 </code>
741 </p>
742   </div>
743 <div class="sws-slide">
744 <h1>Sous-commandes et chaines</h1>
745 <p>Il est pratique de pouvoir mettre <a>l'affichage d'une commande</a>
746   dans une variable. On utilise <tt>$( commande ... )</tt>:
747 <code>
748   MESFICHIER=$(ls *.txt)
749   for i in $MESFICHIER
750   do
751        echo Fichier: $i
752   done
753 </code>
754 Attention à la présence de guillemets autour des variables. S'il y a
755 f1.txt et f2.txt dans le répertoire courant:<br/>
756 <code style="left:10%;position:relative;width:40%;float:left;">
757   MESFICHIER=$(ls *.txt)
758   for i in $MESFICHIER
759   do
760        echo Fichier: $i
761   done
762 <s>affiche:</s>
763   Fichier: f1.txt
764   Fichier: f2.txt
765 </code>
766 <code style="width:40%;float:left;left:10%;position:relative">
767   MESFICHIER=$(ls *.txt)
768   for i in "$MESFICHIER"
769   do
770        echo Fichier: $i
771   done
772 <s>affiche:</s>
773   Fichier: f1.txt f2.txt
774 </code>
775 </p>
776 </div>
777 <div class="sws-slide">
778 <h1>Commandes utiles</h1>
779 <ul>
780   <li><tt>seq <i>m</i> <i>n</i> </tt> : affiche la liste de tous les
781   nombres entre <i>m</i> <i>n</i> </li>
782 <li><tt>echo ... </tt> affiche ses arguments sur la sortie
783   standard</li>
784 <li><tt>printf "chaine" ... </tt> affiche ses arguments au moyen d'une
785   chaine de format (comme le printf de C)</li>
786 <li><tt>date</tt> : affiche la date courante </li>
787 <li><tt>cut</tt> : découpe une chaine selon des caractères de
788   séparations ou des positions</li>
789 </ul>
790 </div>
791 <h1>Programmes non interactifs</h1>
792 <div class="sws-slide">
793   <h1>Processus de type <i>daemon</i></h1>
794 <p>
795   Un <i>daemon</i> (prononcé démon) est un processus
796   qui <em>non-interactif</em> qui tourne en tâche de fond (pas
797   d'entrée/sortie sur le terminal, pas d'interface graphique, …). On
798   communique avec ce processus via des <em>signaux</em> ou en lisant
799   ou écrivant dans des fichiers ou connexions réseau. Le plus souvent,
800   leur but est de fournir un <em>service</em>
801 </p>
802 <p>Exemple de scénario: « <i> Les utilisateurs doivent interagir avec
803     le matériel. L'accès au matériel demande des droits
804     administrateur.</i> »
805 </p>
806 <ul class="empty">
807   <li>Solution 1 : tout le monde est administrateur (DOS, Win XP,
808   …)</li>
809   <li>Solution 2 : on crée un programme particulier qui a les
810   privilèges suffisants pour la tâche en question. Les utilisateurs
811   communiquent avec ce programme</li>
812 </ul>
813 </div>
814 <div class="sws-slide">
815   <h1>Quelques <i>daemons</i> sous Linux</h1>
816 <table class="simple">
817 <tr><th>Nom</th> <th>Description</th> </tr>
818 <tr><td>sshd</td> <td><i>shell</i> distant sécurisé</td> </tr>
819 <tr><td>crond</td> <td>exécution périodique de programmes</td> </tr>
820 <tr><td>cupsd</td> <td>serveur d'impressions</td> </tr>
821 <tr><td>pulseaudio</td> <td>serveur de son (mixe les sons des
822     différentes applications)</td> </tr>
823 <tr><td>udevd</td> <td>détection de matériel <i>hotplug</i></td></tr>
824 <tr><td>nfsd</td> <td>serveur de fichier réseau</td></tr>
825 <tr><td>smtpd</td> <td>livraison des e-mail</td></tr>
826 <tr class="sws-pause"><td><em>httpd</em></td> <td>serveur de pages Web</td></tr>
827 </table>
828 </div>
829 <div class="sws-slide">
830 <h1>Architecture client-serveur</h1>
831 <svg
832    xmlns:svg="http://www.w3.org/2000/svg"
833    xmlns="http://www.w3.org/2000/svg"
834    version="1.1"
835    width="256"
836    height="163.70399"
837    id="svg3">
838   <defs
839      id="defs3115">
840     <marker
841        refX="0"
842        refY="0"
843        orient="auto"
844        id="Arrow2Mend"
845        style="overflow:visible">
846       <path
847          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
848          transform="scale(-0.6,-0.6)"
849          id="path3842"
850          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
851     </marker>
852     <marker
853        refX="0"
854        refY="0"
855        orient="auto"
856        id="Arrow2Mend-9"
857        style="overflow:visible">
858       <path
859          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
860          transform="scale(-0.6,-0.6)"
861          id="path3842-7"
862          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
863     </marker>
864     <marker
865        refX="0"
866        refY="0"
867        orient="auto"
868        id="Arrow2Mend-2"
869        style="overflow:visible">
870       <path
871          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
872          transform="scale(-0.6,-0.6)"
873          id="path3842-3"
874          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
875     </marker>
876     <marker
877        refX="0"
878        refY="0"
879        orient="auto"
880        id="Arrow2Mend-1"
881        style="overflow:visible">
882       <path
883          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
884          transform="scale(-0.6,-0.6)"
885          id="path3842-71"
886          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
887     </marker>
888     <marker
889        refX="0"
890        refY="0"
891        orient="auto"
892        id="marker4143"
893        style="overflow:visible">
894       <path
895          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
896          transform="scale(-0.6,-0.6)"
897          id="path4145"
898          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
899     </marker>
900     <marker
901        refX="0"
902        refY="0"
903        orient="auto"
904        id="Arrow2Mend-11"
905        style="overflow:visible">
906       <path
907          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
908          transform="scale(-0.6,-0.6)"
909          id="path3842-39"
910          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
911     </marker>
912     <marker
913        refX="0"
914        refY="0"
915        orient="auto"
916        id="marker4143-8"
917        style="overflow:visible">
918       <path
919          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
920          transform="scale(-0.6,-0.6)"
921          id="path4145-9"
922          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
923     </marker>
924     <marker
925        refX="0"
926        refY="0"
927        orient="auto"
928        id="Arrow2Mend-6"
929        style="overflow:visible">
930       <path
931          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
932          transform="scale(-0.6,-0.6)"
933          id="path3842-1"
934          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
935     </marker>
936     <marker
937        refX="0"
938        refY="0"
939        orient="auto"
940        id="marker4245"
941        style="overflow:visible">
942       <path
943          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
944          transform="scale(-0.6,-0.6)"
945          id="path4247"
946          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
947     </marker>
948     <marker
949        refX="0"
950        refY="0"
951        orient="auto"
952        id="Arrow2Mend-7"
953        style="overflow:visible">
954       <path
955          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
956          transform="scale(-0.6,-0.6)"
957          id="path3842-8"
958          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
959     </marker>
960     <marker
961        refX="0"
962        refY="0"
963        orient="auto"
964        id="marker4353"
965        style="overflow:visible">
966       <path
967          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
968          transform="scale(-0.6,-0.6)"
969          id="path4355"
970          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
971     </marker>
972     <marker
973        refX="0"
974        refY="0"
975        orient="auto"
976        id="Arrow2Mend-8"
977        style="overflow:visible">
978       <path
979          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
980          transform="scale(-0.6,-0.6)"
981          id="path3842-4"
982          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
983     </marker>
984     <marker
985        refX="0"
986        refY="0"
987        orient="auto"
988        id="marker4353-5"
989        style="overflow:visible">
990       <path
991          d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
992          transform="scale(-0.6,-0.6)"
993          id="path4355-9"
994          style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
995     </marker>
996   </defs>
997   <g
998      transform="translate(-158.9,-91.262203)"
999      id="layer1">
1000     <g
1001        id="g3947">
1002       <g
1003          transform="translate(-1.1999969,-3.4960022)"
1004          id="g4068">
1005         <text
1006            x="166.2"
1007            y="180.85818"
1008            id="text2985"
1009            xml:space="preserve"
1010            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1011              x="166.2"
1012              y="180.85818"
1013              id="tspan2987">Client</tspan></text>
1014         <rect
1015            width="43.800003"
1016            height="21.503998"
1017            rx="5"
1018            ry="5.25"
1019            x="161.2"
1020            y="165.85818"
1021            id="rect3007"
1022            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1023       </g>
1024     </g>
1025     <g
1026        transform="translate(-1.2000122,1.5039978)"
1027        id="g3942">
1028       <text
1029          x="266.20001"
1030          y="175.85818"
1031          id="text2985-1"
1032          xml:space="preserve"
1033          style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1034            x="266.20001"
1035            y="175.85818"
1036            id="tspan3164">Serveur</tspan></text>
1037       <rect
1038          width="53.799988"
1039          height="21.503998"
1040          rx="5"
1041          ry="5.25"
1042          x="261.20001"
1043          y="160.85818"
1044          id="rect3007-8"
1045          style="fill:none;stroke:#0000ff;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1046     </g>
1047     <g
1048        id="g4097">
1049       <path
1050          d="m 210,177.36218 c 15,10 30,10 45,0"
1051          id="path3809"
1052          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1053       <path
1054          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1055          id="path3809-5"
1056          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1057     </g>
1058     <g
1059        transform="translate(210,0)"
1060        id="g3947-5">
1061       <g
1062          transform="translate(-1.1999969,-3.4960022)"
1063          id="g4068-3">
1064         <text
1065            x="166.2"
1066            y="180.85818"
1067            id="text2985-0"
1068            xml:space="preserve"
1069            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1070              x="166.2"
1071              y="180.85818"
1072              id="tspan2987-3">Client</tspan></text>
1073         <rect
1074            width="43.800003"
1075            height="21.503998"
1076            rx="5"
1077            ry="5.25"
1078            x="161.2"
1079            y="165.85818"
1080            id="rect3007-5"
1081            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1082       </g>
1083     </g>
1084     <g
1085        transform="translate(109.96827,1.0864348)"
1086        id="g4097-7">
1087       <path
1088          d="m 210,177.36218 c 15,10 30,10 45,0"
1089          id="path3809-3"
1090          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1091       <path
1092          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1093          id="path3809-5-7"
1094          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1095     </g>
1096     <g
1097        transform="matrix(0.56532555,0.82486788,-0.82486788,0.56532555,266.51188,-153.17986)"
1098        id="g4097-0">
1099       <path
1100          d="m 210,177.36218 c 15,10 30,10 45,0"
1101          id="path3809-2"
1102          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1103       <path
1104          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1105          id="path3809-5-5"
1106          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1107     </g>
1108     <g
1109        transform="translate(40,-70)"
1110        id="g3947-3">
1111       <g
1112          transform="translate(-1.1999969,-3.4960022)"
1113          id="g4068-36">
1114         <text
1115            x="166.2"
1116            y="180.85818"
1117            id="text2985-2"
1118            xml:space="preserve"
1119            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1120              x="166.2"
1121              y="180.85818"
1122              id="tspan2987-4">Client</tspan></text>
1123         <rect
1124            width="43.800003"
1125            height="21.503998"
1126            rx="5"
1127            ry="5.25"
1128            x="161.2"
1129            y="165.85818"
1130            id="rect3007-7"
1131            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1132       </g>
1133     </g>
1134     <g
1135        transform="translate(165,-70)"
1136        id="g3947-1">
1137       <g
1138          transform="translate(-1.1999969,-3.4960022)"
1139          id="g4068-1">
1140         <text
1141            x="166.2"
1142            y="180.85818"
1143            id="text2985-9"
1144            xml:space="preserve"
1145            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1146              x="166.2"
1147              y="180.85818"
1148              id="tspan2987-6">Client</tspan></text>
1149         <rect
1150            width="43.800003"
1151            height="21.503998"
1152            rx="5"
1153            ry="5.25"
1154            x="161.2"
1155            y="165.85818"
1156            id="rect3007-6"
1157            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1158       </g>
1159     </g>
1160     <g
1161        transform="matrix(-0.56532555,0.82486788,0.82486788,0.56532555,302.25486,-153.17986)"
1162        id="g4097-0-8">
1163       <path
1164          d="m 210,177.36218 c 15,10 30,10 45,0"
1165          id="path3809-2-9"
1166          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1167       <path
1168          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1169          id="path3809-5-5-7"
1170          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1171     </g>
1172     <g
1173        transform="translate(40,70)"
1174        id="g3947-3-1">
1175       <g
1176          transform="translate(-1.1999969,-3.4960022)"
1177          id="g4068-36-8">
1178         <text
1179            x="166.2"
1180            y="180.85818"
1181            id="text2985-2-8"
1182            xml:space="preserve"
1183            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1184              x="166.2"
1185              y="180.85818"
1186              id="tspan2987-4-1">Client</tspan></text>
1187         <rect
1188            width="43.800003"
1189            height="21.503998"
1190            rx="5"
1191            ry="5.25"
1192            x="161.2"
1193            y="165.85818"
1194            id="rect3007-7-3"
1195            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1196       </g>
1197     </g>
1198     <g
1199        transform="translate(160,70)"
1200        id="g3947-1-7">
1201       <g
1202          transform="translate(-1.1999969,-3.4960022)"
1203          id="g4068-1-2">
1204         <text
1205            x="166.2"
1206            y="180.85818"
1207            id="text2985-9-4"
1208            xml:space="preserve"
1209            style="font-size:12.5px;font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:DIN;-inkscape-font-specification:DIN Semi-Bold"><tspan
1210              x="166.2"
1211              y="180.85818"
1212              id="tspan2987-6-0">Client</tspan></text>
1213         <rect
1214            width="43.800003"
1215            height="21.503998"
1216            rx="5"
1217            ry="5.25"
1218            x="161.2"
1219            y="165.85818"
1220            id="rect3007-6-4"
1221            style="fill:none;stroke:#ff8305;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
1222       </g>
1223     </g>
1224     <g
1225        transform="matrix(0.56532555,0.82486788,-0.82486788,0.56532555,327.54691,-80.416181)"
1226        id="g4097-0-2">
1227       <path
1228          d="m 210,177.36218 c 15,10 30,10 45,0"
1229          id="path3809-2-3"
1230          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1231       <path
1232          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1233          id="path3809-5-5-5"
1234          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1235     </g>
1236     <g
1237        transform="matrix(-0.56532555,0.82486788,0.82486788,0.56532555,242.10224,-81.191343)"
1238        id="g4097-0-3">
1239       <path
1240          d="m 210,177.36218 c 15,10 30,10 45,0"
1241          id="path3809-2-7"
1242          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1243       <path
1244          d="m 255.84443,171.31278 c -15,-10 -30,-10 -45,0"
1245          id="path3809-5-5-9"
1246          style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Mend)" />
1247     </g>
1248   </g>
1249 </svg>
1250 <p>
1251   <br/><br/>
1252   Des processus <span style="color:blue;">clients</span> communiquent
1253   avec le <span style="color:orange;">serveur</span> à travers le
1254   réseau. Les clients sont indépendant et ne communiquent pas entre
1255   eux. <em>Attention</em> plusieurs clients peuvent se trouver su la
1256   même machine physique!
1257 </p>
1258 </div>
1259 <div class="sws-slide">
1260   <h1>Architecture client-serveur</h1>
1261 <ul>
1262   <li>Le serveur attend des connexions entrantes</li>
1263   <li>Les clients peuvent se connecter à tout moment</li>
1264   <li>L'application client est généralement légère, envoie une
1265   requête au serveur et attend un résultat</li>
1266   <li>Le serveur est une application plus lourde qui:
1267     <ul><li>effectue des calculs trop coûteux pour le client</li>
1268       <li>gère l'accès à une ressource distante partagée<br/>…</li>
1269     </ul>
1270   </li>
1271 </ul>
1272 <p>Exemples: serveur de bases de données, serveur mail, serveur Web,
1273   terminal de carte bancaire, …</p>
1274 </div>
1275   </body>
1276 </html>