【发布时间】:2012-08-14 18:45:23
【问题描述】:
MonoTouch advertises 在其网站上支持AsParallel,代码如下:sn-p:
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 --aot-only 是真实 iOS 设备上唯一可能的模式,因为 Apple 禁止 JIT。
-
这可能是一个错误,在这里报告,并附上一个快速项目来重现它:bugzilla.xamarin.com
标签: c# xamarin.ios task-parallel-library plinq