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