Пример #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);
 }