示例#1
0
        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;
        }
示例#2
0
 static void Task(Data d, Port<int> resp)
 {
     ShellSort(d.row);
     resp.Post(1);
 }
示例#3
0
 static void Task(Data d, Port<int> resp)
 {
     SortBubble(d.row);
     resp.Post(1);
 }