Concurrency Part 5 – WinAPI mutex

This is the fifth part of the Concurrency series. For your convenience you can find other parts in the table of contents in Part 1 – Mutex performance in .NET

Last time we called WinAPI through P/Invoke, today we are going to call it directly.

Code

Results

The results are:

    \[ \begin{array}{cc} Number\ of\ processes & Time [ms] \\ 1 & 110\\ 2 & 605\\ 3 & 905\\ 4 & 1269\\ 5 & 1589\\ 6 & 1920\\ 7 & 2313\\ 8 & 2548\\ 9 & 2950\\ 10 & 3250\\ \end{array} \]

As you can see, the results are very similar to the P/Invoke ones.