In c# 4.0, Microsoft has introduced a new namespace with name “System.Collections.Concurrent” which provide set of collections having thread safe behavior.
Some of these thread safe collections are as:
| Class |
| BlockingCollection<T> |
| ConcurrentBag<T> |
| ConcurrentDictionary<TKey, TValue> |
| ConcurrentQueue<T> |
| ConcurrentStack<T> |
| OrderablePartitioner<TSource> |
| Partitioner |
| Partitioner<TSource> |
Lets take example of example of Queue data structure, Simple queue is explained here
http://msdn.microsoft.com/en-us/library/system.collections.queue.aspx
The generic version of queue is explained here.
http://msdn.microsoft.com/en-us/library/7977ey2c.aspx
Before arrival of C# 4.0, thread safety in queue was ensured by using Queue.Synchronized as explained at:
http://msdn.microsoft.com/en-us/library/system.collections.queue.synchronized.aspx
But now we have better implementation of thread safe queue with System.Collections.Concurrent namespace, as explained here:
These new types rock!
Did you already use them in a project?
CU
.peter.gfader.
http://blog.gfader.com/
http://twitter.com/peitor
This namespace is really good addition to .net family.
Yes, in all the new projects. We heavy insist developers to use them.
Saw your blog… interesting stuff.
Shahzad
http://www.shahzadsb.com
Thx
What I love about this new Concurrent types is that
#1 Code is much easier to write without locks in place
#2 Readability is so much better without locks
Very much true…
Hi, it’s nice here so I am just saying hi. I’ve been reading forums for a month now and decided to register. Hope that my english will be good enough to communicate with you
. My hobby are airplanes and my hobby page – http://www.aviao.pl – bilety lotnicze it’s about them.
פטרת הינה בעיה נפוצה במיוחד בקרב האוכלוסיה ולי יש המלצה לפתרון:
חדשנות בטיפול בפטרת ציפורניים
הריגת פטרת השוכנת מתחת לציפורניים,
בשנים האחרונות התפתח תחום הטיפול בפטרת ציפורניים.
שיטה חדשנית תעזור לכם
בחיסול הפטריות
אני ממליצה בחום על פטרת קליניק כמרפאה המובילה לחיסול פטרת ציפורניים בלייזר.
ביטחון מלא בהצלחת הטיפול!
ניתן לזהות בכמה דרכים מתי אדם סובל מפטרת
סירחון, שינוי צבע הציפורן לגוון צהוב או סגול.