- File:
-
- 1 edited
-
doc/proposals/concurrency/text/results.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/concurrency/text/results.tex
r5c4f2c2 r6090518 40 40 All benchmarks are run using the same harness to produce the results, seen as the \code{BENCH()} macro in the following examples. This macro uses the following logic to benchmark the code : 41 41 \begin{pseudo} 42 #define BENCH(run, result) //Param: What to run, variable containing result42 #define BENCH(run, result) 43 43 before = gettime(); 44 44 run; … … 49 49 50 50 \subsection{Context-Switching} 51 The first interesting benchmark is to measure how long context-switches take. The simplest approach to do this is to yield on a thread \footnote{Yielding causes the thread to context-switch to the scheduler and back, more precisely: from the \gls{uthread} to the \gls{kthread} then from the \gls{kthread} back to the same \gls{uthread} (or a different one in the general case).}, which executes a 2-step context switch. In order to make the comparison fair, coroutines also execute a 2-step context-switch by resuming another coroutine which does nothing but suspending in a tight loop, which is a resume/suspend cycle instead of a yield. Listing \ref{lst:ctx-switch} shows the code for coroutines and threads with the results in table \ref{tab:ctx-switch}. All omitted tests are functionally identical to one of these tests. The difference between coroutines and threads can be attributed to the cost of scheduling.51 The first interesting benchmark is to measure how long context-switches take. The simplest approach to do this is to yield on a thread, which executes a 2-step context switch. In order to make the comparison fair, coroutines also execute a 2-step context-switch (\gls{uthread} to \gls{kthread} then \gls{kthread} to \gls{uthread}), which is a resume/suspend cycle instead of a yield. Listing \ref{lst:ctx-switch} shows the code for coroutines and threads with the results in table \ref{tab:ctx-switch}. All omitted tests are functionally identical to one of these tests. 52 52 \begin{figure} 53 53 \begin{multicols}{2} … … 199 199 \multicolumn{1}{c |}{} & \multicolumn{1}{c |}{ Median } &\multicolumn{1}{c |}{ Average } & \multicolumn{1}{c |}{ Standard Deviation} \\ 200 200 \hline 201 Pthreads Condition Variable & 5902.5 & 6093.29 & 714.78 \\202 201 \uC \code{signal} & 322 & 323 & 3.36 \\ 203 202 \CFA \code{signal}, 1 \code{monitor} & 352.5 & 353.11 & 3.66 \\
Note:
See TracChangeset
for help on using the changeset viewer.