So I have had a chance to look at the CTP briefly and I’ve found a few things of interest
- There are currently breaking changes, and .Net 4 installs side by side with .net 3.5 much like 1.1 does with 2.0. (Array.Sort method change from the .Net 3.5 beta is back.)
- BigInteger is now public and in System rather than System.Core
- System.Core has a few command line app tools, including a command line parser.
- With the dispose pattern it is no longer considered bad to have Dispose being virtual.
- Code contract support, I believe the compiler is allowed to optimize based on assertions made using code contracts.
- AggregateException, an exception containing multiple exceptions. Useful for parallel or pseduo parallel task execution.
- Concurrent data structures, several of them.
- Parallel task library integrated into mscorlib
- A couple of helper classes for common multithread tasks. LazyInit/WriteOnce.
- Monitor now has methods which use ref parameter for lock taken rather than return value. This allows for reliable lock release, which was previously impossible since an asynchronous exception could occur inside Monitor.TryEnter. Additionally Monitor.Enter also allows for the scenario where an asynchronous exception is thrown during its execution, and has a ref lock taken parameter as well.
- ManualResetEventSlim, SemaphoreSlim – cheaper non-named synchronization control objects.
- SpinWait/SpinLock
- Barrier, a multiple worker thread synchronization structure.
- Supported platforms attribute, platforms enumeration includes unix, mac, winCE and xbox(?!?) as well as 3 types of win32.
- Some attributes and reflection stuff for improved com interop capabilities without requiring interop assemblies. This includes a magical feature where two seperate interfaces can be identified as being the same interface and the runtime magically pretends they are the same internally, as much as it can.
I haven’t really played arround with c# 4 yet, so I haven’t discovered any cool new syntax. (Although I’ve heard about dynamic, and generic variance.)
Also i’ve really only looked at mscorlib and system. System.Core was a brief eyeball in reflector, everything else I’ve not had a chance to examine.