It is an interesting question - could any of the new features in .NET 4 be useful inside a MEF implementation? The MEF API should be compatible between .NET 3.5SP1 and .NET 4.0, but internally, can/should more use be made of what is new in .NET 4.0? ("What's
New in the .NET Framework 4" - http://msdn.microsoft.com/en-us/library/dd409230(VS.100).aspx )
I'll pick just one area that I think could be of huge benefit - the new .NET 4.0 parallel functionality.
In MEF Preview 5, are CPU-intensive areas of MEF - namely CompositionEngine and the catalogs, optimized for multicore hardware? There is some threading usage in MEF (locks and Thread.MemoryBarrier) but can it be enhanced?
Intel will shortly have its Nehalem-EX 8-core processor on the market, with each core running two threads concurrently, and many boxes will have a pair of these processors - so 32 concurrent threads. These boxes will be expensive at the end of 2009, reasonably
priced at the end of 2010 and cheap at the end of 2011.
How will a substantial MEF app (e.g. 50 assemblies, 100,000 classes, with maybe 500 classes having MEF imports/exports) run on such a box? During app startup, will Windows Task Manager show one thread 100% busy and 31 idle, or will there be a more even distribution
of the workload?
Are types that use Parallel .NET such as ParallelCompositionEngine and ParallelDirectoryCatalog needed, or should the fact that they work great in a multicore envronment just be in the normal version?