[Mono-dev] [PATCH] System.Threading.Parallel
andreas.faerber at web.de
Fri Dec 21 10:37:48 EST 2007
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:
A + class/System.Threading.Parallel/Assembly/AssemblyInfo.cs
A + class/System.Threading.Parallel/
A + class/System.Threading.Parallel/Makefile
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.
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.
>> 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
>> 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?
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
More information about the Mono-devel-list