Programming & Languages

C# Monitor,Busy Wait,True Wait & SpinLock

Aug 21st, 2010 | By sankarsan | Category: Programming & Languages

In my last two posts I had discussed about thread synchronization,critical sections and System.Threading.Monitor class.What we have seen is, a critical section in the code where thread synchronization is required is protected by a lock.When a thread encounters a critical section it tries to acquire the lock,if successful it executes the code or else waits [...]



C# Monitor – Some Important Points

Aug 1st, 2010 | By sankarsan | Category: Programming & Languages

In my last post I started the discussion on race conditions and thread synchronization technique using Monitor/lock in C#.In this post also, we will continue with the same and discuss some important points related to the Monitor class.



Race Condition & Synchronization in C#

Jul 18th, 2010 | By sankarsan | Category: Programming & Languages

We have heard about the term race condition in relation to threads.This is basically a scenario where two or more threads are competing(racing) to read/write from a shared memory location leading to the possibilities of leaving the program in an inconsistent state.



Single Assignment & readonly Fields in C#

Jun 27th, 2010 | By sankarsan | Category: Programming & Languages

We have all heard about immutable objects, the objects whose field values cannot be altered throughout it’s lifetime.Immutable objects are simpler to deal with in case concurrent programs where they can be shared between multiple threads.The single assignment variables variables which is once assigned a value cannot be reassigned again.These are inherently immutable in nature.In [...]



A Deeper Look Into Javascript – Part I

Sep 28th, 2009 | By sankarsan | Category: Programming & Languages

Javascript has been around since the early days of Web and is already embedded into the millions of web pages for performing client(browser) side actions.But because of some reason it was never taken too seriously in the initial days compared to the languages that were used for server side programming.Back in 2000 when I started [...]