MonoTouch advertises supporto per AsParallel
sul proprio sito web con questo frammento di codice:AsParallel crash un'applicazione MonoTouch
from item in items.AsParallel()
let result = DoExpensiveWork (item)
select result;
Tuttavia, anche un campione banale blocca la mia app:
var items = new [] { 1, 2, 3 };
var twice = (
from x in items.AsParallel()
select 2 * x
).ToArray();
So che MonoTouch non può gestire metodi generici virtuali ma PLINQ non dovrebbe funzionare?
Cosa c'è di sbagliato che sto facendo?
La versione mono-touch è 5.3.5.
Lo stesso vale per 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 è l'unica modalità possibile sul dispositivo iOS reale perché JIT è vietato da Apple. –
Questo è probabilmente un bug, riporta qui e allega un rapido progetto per riprodurlo: http://bugzilla.xamarin.com – jonathanpeppers