\documentclass{article} \usepackage{pgfgantt} \usepackage[margin=1cm]{geometry} \newganttlinktype{arr}{ \draw [/pgfgantt/link] (0.5,-0.5) -- (0.5, 0);} \newganttlinktype{rel}{ \ganttsetstartanchor{on left=0} \ganttsetendanchor{on left=1} \draw [/pgfgantt/link] (\xLeft, \yLower) -- (\xLeft, \yUpper);} \newganttlinktype{done}{ \ganttsetstartanchor{on right=0} \ganttsetendanchor{on right=1} \draw [/pgfgantt/link] (\xRight, \yUpper) -- (\xRight, \yLower);} \newcommand{\barstart}{+2} \newcommand{\barend} {+1} \newcommand{\taskarrive}[2]{ \draw [/pgfgantt/link] (#1*0.5+0.5, #2*-2+1) -- (#1*0.5+0.5, #2*-2+2); } \begin{document} \pagenumbering{gobble} \begin{center} \begin{ganttchart}[ x unit = 0.5cm, bar height = 0.5, bar top shift = 0.5, title right shift=1, title/.style={draw=none, fill=none}, title top shift=1, include title in canvas=false, canvas/.style={draw=none} ]{0}{50} % t1 \ganttbar{$t_{1}$}{0\barstart}{2\barend} \ganttlink[link type=rel]{elem0}{elem0} \ganttlink[link type=done]{elem0}{elem0} \ganttbar{$t_{1}$}{10\barstart}{12\barend} \ganttlink[link type=rel]{elem1}{elem1} \ganttlink[link type=done]{elem1}{elem1} \ganttbar{$t_{1}$}{20\barstart}{22\barend} \ganttlink[link type=rel]{elem2}{elem2} \ganttlink[link type=done]{elem2}{elem2} \ganttbar{$t_{1}$}{30\barstart}{32\barend} \ganttlink[link type=rel]{elem3}{elem3} \ganttlink[link type=done]{elem3}{elem3} \gantttitlelist{0,,2,,,,,,,,10,,12,,,,,,,,20,,22,,,,,,,,30,,32}{1} \\\\ % t2 \ganttbar{$t_{2}$}{2\barstart}{6\barend} \ganttlink[link type=rel]{elem4}{elem4} \ganttlink[link type=done]{elem4}{elem4} \ganttbar{$t_{2}$}{15\barstart}{19\barend} \ganttlink[link type=rel]{elem5}{elem5} \ganttlink[link type=done]{elem5}{elem5} \ganttbar{$t_{2}$}{32\barstart}{36\barend} \ganttlink[link type=rel]{elem6}{elem6} \ganttlink[link type=done]{elem6}{elem6} \gantttitlelist{0,,2,,,,6,,,,,,,,,15,,,,19,,,,,,,,,,,30,,32,,,,36}{1} \\\\ % t3 \ganttbar{$t_{3}$}{6\barstart}{10\barend} \ganttlink[link type=rel]{elem7}{elem7} \ganttbar{$t_{3}$}{12\barstart}{15\barend} \ganttbar{$t_{3}$}{19\barstart}{20\barend} \ganttbar{$t_{3}$}{22\barstart}{30\barend} \gantttitlelist{0,,,,,,6,,,,10,,12,,,15,,,,19,20,,22,,,,,,,,30}{1} \taskarrive{0}{1} \taskarrive{10}{1} \taskarrive{20}{1} \taskarrive{30}{1} \taskarrive{0}{2} \taskarrive{15}{2} \taskarrive{30}{2} \taskarrive{0}{3} \end{ganttchart} \begin{description} \item[digits] time \item[left column] tasks \item[up arrow, {\em tall}] arrival \item[up arrow, {\em short}] release \item[down arrow] completion \item[bar] execution (task allocated CPU) \item[{\em beginning} of bar, no arrow] preemption (context switch {\em load}) \item[{\em end} of bar, no arrow] preemption (context switch {\em save}); or, failure to meet deadline \end{description} \end{center} \end{document}