Multithreading: C# vs. Java
jj09.net
jj09.net
I use Java some so I can't speak directly to this but I would bet Java pros are scratching their heads over the Java code being used here as well.
What is more interesting to me though; why even make the comparison? Are there legions of programmers out there who cannot pick between these two platforms because they cannot decide who has better a better threading approach?
It is also a pretty bad example of C# threading capabilities.
From ThreadPool[1], Tasks[2] and more recently async/await[3], there's a lot more than vanilla threads in C#.
[1] http://msdn.microsoft.com/en-us/library/3dasc8as.aspx
[2] http://msdn.microsoft.com/en-us/library/dd460717(v=vs.110).a...
For example, the Task Parallel Library is built in to the BCL [1] with some extensions [2] shipped out of band.
Although Java's constructs seem less comprehensive than what's in .NET [3]. (Disclaimer: I'm a .NET programmer and I don't know all the Java namespaces).
[1] http://msdn.microsoft.com/en-us/library/dd460717(v=vs.110).a...
[2] http://msdn.microsoft.com/en-us/library/hh228603(v=vs.110).a...
[3] http://docs.oracle.com/javase/8/docs/api/java/util/concurren...