Forums

Great concurrency support in .NET for Cobra on Windows

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Great concurrency support in .NET for Cobra on Windows

Postby todd.a » Fri Nov 06, 2009 1:17 pm

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

Postby Charles » Fri Nov 06, 2009 3:27 pm

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.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Great concurrency support in .NET for Cobra on Windows

Postby todd.a » Sat Nov 07, 2009 11:15 am

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) :D. 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

Postby Charles » Sat Nov 07, 2009 5:06 pm

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


Return to Discussion

Who is online

Users browsing this forum: No registered users and 52 guests