어느 하나 또는 그 이상의 시나리오가 아닙니다. CCR은 특정 프로그래밍 패턴을 지원하는 라이브러리입니다. 현재,이 같은 CCR 및 TPL 코드를 혼용 수신 위임의 내부 Parallel.For입니다 수 있습니다
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Ccr.Core;
namespace Demo
{
public class Program
{
public static void Main(string[] args)
{
Dispatcher dispatcher = new Dispatcher();
DispatcherQueue taskQueue = new DispatcherQueue("Demo", dispatcher);
Port<int> portInt = new Port<int>();
portInt.Post(Int32.Parse(args[0]));
Arbiter.Activate(
taskQueue,
portInt.Receive(delegate(int count)
{
Parallel.For(0, count, i =>
{
Console.Write(i.ToString() + " ");
});
}
));
}
}
}
읽기 얼랑 동시성, CCR은 얼랑 동시성 복사, 전형적인 마이크로 소프트의 방법입니다. 작업 parellel는 멀티 스레드입니다 – mamu