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