SPB Git

Repository Public MIT Research preview

MA02-F05-propagation-annulation.tex 2.7 KB 32 lines latex

1% MA02-F05 — Propagation d'une annulation dans un arbre de tâches : l'échéance du lot de démonstration, à 700 ms.2% Idée : l'annulation DESCEND l'arbre. La minuterie lève dans le groupe ; le groupe annule chaque agent ; l'agent3% reçoit CancelledError à son prochain point d'attente ; il range (place rendue, portées fermées, état « annulé »),4% puis laisse l'exception remonter. Ce que chaque agent tenait à 700 ms vient de l'exécution (MA02-donnees.tex).5\input{MA02-donnees.tex}%6\begin{tikzpicture}[x=1mm, y=1mm]7  \path (0,0) rectangle (142,56);8  \node[atlas block strong, minimum width=40mm, minimum height=7.6mm] (lot) at (83.8,51.6) {lot \enspace\texttt{asyncio.TaskGroup}};9  \node[atlas block hazard, minimum width=25mm, minimum height=9.6mm, align=center, font=\AtlasSizeTiny\bfseries] (min) at (14,41) {minuterie\\ échéance \MBEchMs\ ms};10  \draw[atlas arrow hazard, line width=1.4pt] (min.north) .. controls (14,51.6) .. (lot.west);11  \node[atlas step=maRisque] at (27,53) {1};12  \node[atlas note, anchor=west, text=maRisque] at (30,53.6) {lève dans le groupe};13  \foreach \k/\t/\g in \MBEchAgents {14    \pgfmathsetmacro{\x}{22+20.6*\k}15    \node[ma sous agent, minimum width=18.6mm, minimum height=6.4mm, font=\AtlasSizeTiny\bfseries] (ag\k) at (\x,38) {agent-\k};16    \draw[atlas arrow hazard] (lot.south) -- (ag\k.north);17    \ifdefstring{\g}{a}{\def\quoi{appel en vol}}{\def\quoi{attend sa place}}18    \node[ma tache, draw=maRisque, minimum width=18.6mm, minimum height=9.4mm, align=center, inner xsep=1pt, font=\AtlasSizeTiny] (tr\k) at (\x,24.2)19      {\texttt{\t}\\ \quoi};20    \draw[atlas arrow hazard] (ag\k.south) -- (tr\k.north);21    \node[ma etat terminal=maRisque, minimum height=5.4mm, inner ysep=1.4pt, font=\AtlasSizeTiny\bfseries] (fin\k) at (\x,10.6) {annulé};22    \draw[atlas arrow muted] (tr\k.south) -- (fin\k.north);}23  \node[atlas step=maRisque] at (109,51.6) {2};24  \node[atlas note, anchor=west, text=maRisque] at (112.4,51.6) {annule chaque agent};25  \node[atlas step=maRisque] at (29.6,31.2) {3};26  \node[atlas note, anchor=east, align=right, text=maRisque] at (26.4,29.4) {\texttt{CancelledError}\\ au prochain \texttt{await}};27  \node[atlas step=maRisque] at (29.6,17.4) {4};28  \node[atlas note, anchor=east, align=right, text=maTexte] at (26.4,17) {l'agent range :\\ place rendue,\\ portées fermées};29  \node[atlas note, anchor=north west, align=left, text=maTexte] at (0,7.4) {dans la file, jamais commencés : \texttt{\MBEchDansLaFile}\enspace → annulés aussi};30  \node[atlas tag=maValide, anchor=south east] at (142,0) {À \MBEchMs\ MS : \MBEchReussis\ RÉUSSIS · \MBEchAnnules\ ANNULÉS · 0 APPEL EN VOL · 0 ORPHELIN};31\end{tikzpicture}32
Files main
Menu

Theme