[Mono-dev] [PATCH] System.Threading.Parallel

Andreas Färber andreas.faerber at web.de
Fri Dec 21 10:37:48 EST 2007


Hi Marek,

Thanks for the comments. I do not see such an example in my diff: I  
have not modified corlib yet, just svn-copied and modified the  
relevant build files from another assembly and added my own, see  
below. ECMA_PARALLEL_SUPPORT is not being defined anywhere, should I  
better use #if 0 to make it more obvious?

svn status w/o irrelevant parts:
M      class/Makefile
?      class/System.Threading.Parallel/TestResult-NET_2_0.log
?      class/System.Threading.Parallel/ 
System.Threading.Parallel_test_NET_2_0.dll.mdb
A      class/System.Threading.Parallel
A      class/System.Threading.Parallel/Assembly
A  +   class/System.Threading.Parallel/Assembly/AssemblyInfo.cs
A      class/System.Threading.Parallel/Assembly/ChangeLog
A  +   class/System.Threading.Parallel/ 
System.Threading.Parallel.dll.sources
A      class/System.Threading.Parallel/Test
A      class/System.Threading.Parallel/Test/System.Threading.Parallel
A      class/System.Threading.Parallel/Test/System.Threading.Parallel/ 
ChangeLog
A      class/System.Threading.Parallel/Test/System.Threading.Parallel/ 
ParallelForTest.cs
A      class/System.Threading.Parallel/Test/System.Threading.Parallel/ 
ParallelForEachTest.cs
A      class/System.Threading.Parallel/Test/System.Threading.Parallel/ 
ParallelWhileTest.cs
A      class/System.Threading.Parallel/System.Threading.Parallel
A      class/System.Threading.Parallel/System.Threading.Parallel/ 
ParallelFor.cs
A      class/System.Threading.Parallel/System.Threading.Parallel/ 
ChangeLog
A      class/System.Threading.Parallel/System.Threading.Parallel/ 
ParallelForEach.cs
A      class/System.Threading.Parallel/System.Threading.Parallel/ 
ParallelWhile.cs
A      class/System.Threading.Parallel/System.Threading.Parallel/ 
ParallelLoop.cs
A      class/System.Threading.Parallel/ChangeLog
A  +   class/System.Threading.Parallel/Makefile
A      class/System.Threading.Parallel/ 
System.Threading.Parallel_test.dll.sources
M      class/ChangeLog

This patch seems independent of Microsoft's new parallel library, and  
the extensible way of implementing it I suggested on another thread  
would likely enable us to share backends between both libraries. That  
part is not implemented yet, I'd like to have a working base revision  
first, which this patch is intended as. Would be great if we could get  
something in before Christmas, then I can work on the next gen between  
the years before I start my number crunching in January.

Concerning corlib, Dennis posted a list of namespaces affected by  
Microsoft's new library, and ParallelEnvironment would not seem to  
conflict with that. More than that I do not know. Personally, I'd  
rather stick with the published ECMA standard and a superior Mono  
implementation than with some evolving Microsoft CTP potentially  
leading to IPR questions at some point. Virtually nobody uses their  
Compute Cluster Edition anyway.

Andreas


Am 21.12.2007 um 15:23 schrieb Marek Safar:

> Hi Andreas,
>
> It seems to me your diff is not complete as some files rely on  
> working copy of files which don't exist.
>
> I would not add this to corlib as it may cause problems later when  
> MS introduces better "Parallel" library support.
>
> Marek
>>
>> Attached is a patch adding the System.Threading.Parallel assembly,  
>> an optional part of the ECMA-335 standard (Annex G). The initial  
>> implementation is single-threaded, as permitted by the standard.  
>> All my test cases pass. Please review.
>>
>> Am I correct to use the ecma.pub key for this ECMA-only assembly?
>>
>> And am I seeing correctly that the ECMA docs do not document  
>> protected methods? I used "internal protected" to be on the safe  
>> side for now.
>>
>> There are some comments inline, documenting where I needed to  
>> interpret the standard. For instance, the standard says an  
>> exception should be rethrown in EndRun, which I am doing now, but  
>> this of course hides the original source of the exception, so maybe  
>> we should not rethrow it but throw some new exception with it as  
>> InnerException?
>>
>>
>> To completely support the "Parallel" Library, in addition the  
>> ParallelEnvironment class would need to be implemented inside  
>> corlib. But with Microsoft not having supported it, relying on its  
>> presence would keep users from deploying this assembly to .NET. The  
>> proposed implementation therefore uses conditional sections where  
>> ParallelEnvironment should theoretically be used.
>>
>> Adding that class to corlib might require a new icall for  
>> ParallelEnvironment,RecommendedMaxThreads (to discover the number  
>> of processors/cores), and if so I assume the corlib version would  
>> need to be incremented?
>>
>> Thanks,
>>
>> Andreas
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>




More information about the Mono-devel-list mailing list