EF 6: Async

2013/03/19

EF 6: Async this post is the first in a series about what's new in EF 6. great improvements are about to come with Entity Framework 6. it is a major release and the first one since EF become an open source. each post in the series will be dedicate to a single feature. this post will focus on a new EF a-sync features. the first question that should be asked is, why do we need parallel data access? moreover why...

Parallel and The C# Memory Model

2013/03/06

Parallel and The C# Memory Model Parallel programming can be tricky, both compiler and CPU's optimization can lead into a twilight zone's debugging. lets take the following code snippet snippet: Code Snippet class Program {     static void Main(string args)     {         Console.WriteLine("Start");         var u = new Util();         u.Exec();         Console.ReadKey();     } }   public class Util {     private bool _stop = true;     public void Exec()     {         Task t = Task.Run(() =>             {                 bool b = true;                 while (_stop)                 {                     b = !b;                 }                 Console.WriteLine("Complete {0}", b);             });         Thread.Sleep(30);         _stop = false;     } } ...