multithreading in c# - pitfalls, mistakes and solutions. goyello olivia tech talks 20014_08

12
The most common developer mistakes in modern business applications. „Multithreading in C# pitfalls, mistakes and solutions.” [email protected] Senior .NET Developer Microsoft MVP @D3M80L Olivia Tech Talks 7 VIII 2014

Upload: goyello

Post on 26-Jun-2015

87 views

Category:

Software


0 download

DESCRIPTION

The most common developer mistakes in modern business applications.

TRANSCRIPT

Page 1: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

The most common developer mistakes

in modern business applications.

„Multithreading in C#

pitfalls, mistakes and solutions.”

[email protected] Senior .NET Developer

Microsoft MVP @D3M80LOlivia Tech Talks 7 VIII 2014

Page 2: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Agenda

A briefoverview

Run and explain

Discussion

Page 3: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Thread – a brief overview

Page 4: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Thread overuse

Page 5: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Thread overviewThread Kernel Object – 350~1240B

Thread Environment Block – 4KB

User Mode Stack – 1MB

Kernel Mode Stack – 12~24KB

Page 6: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08
Page 7: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

https://github.com/D3M80L/SharpProject/tree/master/Threading

Page 8: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Structure of our examples

• 'Example' class and 'ExampleTest'

– OnRun – where the example logic is placed

• State Machine

– Detect 'states' to track excecution point

• Unit Tests and standalone application

– Quickly proof the example

Page 9: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Step by step

Page 10: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Questions

Page 11: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

Materials

• Threading in C# - Joseph Albahari

• CLR via C# (4th ed) – Jeffrey Richter

• Patterns of paralel programming – Stephen Toub, Microsoft

• Windows Via C/C++ - Jeffrey Richter and Christophe Nasarre

Page 12: Multithreading in C# - pitfalls, mistakes and solutions. Goyello Olivia Tech Talks 20014_08

The most common developer mistakes

in modern business applications.

„Multithreading in C#

pitfalls, mistakes and solutions.”

[email protected] Senior .NET Developer

Microsoft MVP @D3M80LOlivia Tech Talks 7 VIII 2014