MonoTouch advertises hỗ trợ cho AsParallel
trên website của mình với đoạn mã này:AsParallel đâm một ứng dụng MonoTouch
from item in items.AsParallel()
let result = DoExpensiveWork (item)
select result;
Tuy nhiên, thậm chí là một mẫu tầm thường treo ứng dụng của tôi:
var items = new [] { 1, 2, 3 };
var twice = (
from x in items.AsParallel()
select 2 * x
).ToArray();
Tôi biết MonoTouch không thể xử lý các phương pháp chung ảo nhưng PLINQ không được phép hoạt động?
Tôi đang làm gì sai?
Phiên bản MonoTouch là 5.3.5.
Cùng đi cho 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 - chỉ có thể là chế độ duy nhất có thể trên thiết bị iOS thực vì JIT bị cấm bởi Apple. –
Đây có thể là một lỗi, báo cáo ở đây và đính kèm một dự án nhanh để tái tạo nó: http://bugzilla.xamarin.com – jonathanpeppers