MonoTouch的advertises为AsParallel
支持在其网站上使用此代码片段:AsParallel已轰然一个MonoTouch的应用
from item in items.AsParallel()
let result = DoExpensiveWork (item)
select result;
然而,即使是微不足道的样本崩溃我的应用程序:
var items = new [] { 1, 2, 3 };
var twice = (
from x in items.AsParallel()
select 2 * x
).ToArray();
我知道MonoTouch不能处理虚拟泛型方法,但不是PLINQ应该工作?
我在做什么错?
MonoTouch版本是5.3.5。
也是一样Parallel.ForEach
:
System.AggregateException: One or more errors occured ---> System.Exception:
Attempting to JIT compile method 'System.Threading.Tasks.Parallel:<ForEach`1>m__36<int>()' while running with --aot-only.
See http://docs.xamarin.com/ios/about/limitations for more information.
@James:AFAIK - 只有在真实iOS设备上才可能使用的唯一模式,因为JIT被Apple禁止。 – 2012-08-14 19:02:15
这可能是一个错误,在这里报告,并附上一个快速项目来重现它:http://bugzilla.xamarin.com – jonathanpeppers 2012-08-14 19:07:26