static void ParallelShellSort() { Dispatcher dispatcher = new Dispatcher(arraySize, "THREAD_POOL"); DispatcherQueue dsipQueue = new DispatcherQueue("Dispatcher", dispatcher); Port<int> port = new Port<int>(); for (int i = 0; i < arraySize; ++i) { Data d = new Data(); d.row = i; Arbiter.Activate(dsipQueue, new Task<Data, Port<int>>(d, port, Task)); } return; }
static void Task(Data d, Port<int> resp) { ShellSort(d.row); resp.Post(1); }
static void Task(Data d, Port<int> resp) { SortBubble(d.row); resp.Post(1); }