The Task Parallel Library (TPL)[1] is basically like goroutines in Go. They're a concurrency construct, for executing code that gets multiplexed to threads via the thread pool by default. Absurdly useful and very easy to use. This contains stuff like Task, Parallel.ForEach, .ContinueWith() etc.
The TPL Dataflow[2] stuff added just recently is data pipelining. Completely thread-safe communication of data, with the ability to construct a complex data pipeline that your data gets pushed through. Similar to channels in Go.
Also added recently are the async and await keywords[3] in C# and VB.NET. These are compiler features that allow you to write asynchronous code exactly the same way as you would write synchronous code. Basically a replacement for the IAsyncResult + BeginFoo/EndFoo pattern, it allows you to write simple and readable asynchronous code. Not necessarily multi-threaded as it can be used with single-threaded code, but it allows the stuff that interacts with your multi-threaded code to not bend over backwards for it.
[1] http://msdn.microsoft.com/en-us/library/dd460717.aspx
It enhances support for the IObservable/IObserver interfaces, the duals of IEnumerable/IEnumerator, allowing Linq manipulation of asynchronous events.
As others have discussed or at least alluded to, C# certainly started out on a par with Java, but has grown into a different beast altogether, if one makes use of all the new developments mentioned.
These days my C# code is very un-Java-like, and far more Functional.
- User-defined value types
- Lambdas
- An equivalent to LINQ (and PLINQ)
- Language-level support for asynchronous programming
- True generics (Java's implementation is essentially syntactic sugar on good old-fashioned typecasting.)
- Extension methods
- Late binding
While I don't disagree that C# is good, I don't see how
you could say that Java is in any way behind.
GP: [List of features where Java is behind.]
(May have missed that the sub-thread is about 'scalable, concurrent systems', though typical C# development leaves threading worries to ASP.NET/SQL libraries.)Personally, I would appreciate it if you'd share how Java threading beats C# threading, particularly C#'s async/await. I don't know much about Java.
I'm not terribly versed in what Java's got going for it in the concurrency department, so I'm not really qualified to speak to that. The stuff that's been happening in C# and .NET since version 3 is pretty fantastic, IMO, but I don't really know the details about how what Java has compares.