Forums
Great concurrency support in .NET for Cobra on Windows
4 posts
• Page 1 of 1
Great concurrency support in .NET for Cobra on Windows
I noticed that there is now a System.Collections.Concurrent namespace in .NET 4 beta 2 (didn't catch my attention in beta 1 so it could have been there). This makes Actor style programming a lot easier as the concurrency issues regarding the collection is dealt with for you.
- todd.a
- Site Admin
- Posts: 81
- Location: Chicago, IL
Re: Great concurrency support in .NET for Cobra on Windows
How about some URLs to go with it? Here is the MSDN page for the namespace:
http://msdn.microsoft.com/en-us/library/system.collections.concurrent(VS.100).aspx
I wonder if these classes could be backported to .NET 2.0 which already has support for threads and locking? Here is Mono's implementation:
http://anonsvn.mono-project.com/source/trunk/mcs/class/corlib/System.Collections.Concurrent/
One other note: You don't have to wait for .NET 4.0 to get easy multi-threading around collections. I did it in Cobra's own test runner by putting a "lock" on an ordinary Queue and accessing its .count and .dequeue methods inside the locked block. 'Twas easy.
http://msdn.microsoft.com/en-us/library/system.collections.concurrent(VS.100).aspx
I wonder if these classes could be backported to .NET 2.0 which already has support for threads and locking? Here is Mono's implementation:
http://anonsvn.mono-project.com/source/trunk/mcs/class/corlib/System.Collections.Concurrent/
One other note: You don't have to wait for .NET 4.0 to get easy multi-threading around collections. I did it in Cobra's own test runner by putting a "lock" on an ordinary Queue and accessing its .count and .dequeue methods inside the locked block. 'Twas easy.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Great concurrency support in .NET for Cobra on Windows
Geez Chuck, I believe the key phrases I used were "a lot easier" and "dealt with for you" meaning, I have no desire to implement code that allows removing from a collection while enumerating it, but if .NET/Mono gives me the ability to, then why not (when needed of course) . This convenience lends a hand with regard to common patterns such as the Producer-Consumer pattern too.
- todd.a
- Site Admin
- Posts: 81
- Location: Chicago, IL
Re: Great concurrency support in .NET for Cobra on Windows
It wasn't a criticism of you or your post. I just wanted to make sure that readers did not get the impression that concurrent programming was not currently available or usable.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 52 guests