Example #1
0
        protected void ComputeNonParallel(PatternNodePPA node, ResultPPA result)
        {
            if (depthComputed > node.Permutation.Length + descendantsDepth)
            {
                List <PatternNodePPA> children;
                node.TryGetChildren(out children);
                foreach (var child in children)
                {
                    ComputeStep(child, result);

                    ComputeNonParallel(child, result);
                }

                node.DisposeChildren();
                node.DisposeDescendants();
            }
        }
Example #2
0
        protected void ComputeParallelHandler(PatternNodePPA node, ResultPPA result, int numThreads)
        {
            if (depthComputed > node.Permutation.Length + descendantsDepth && node.CountChildren > 0)
            {
                if (numThreads == 1)
                {
                    ComputeNonParallel(node, result);
                }
                else
                {
                    if (numThreads < node.CountChildren)
                    {
                        ComputeParallelUnSufficientThreads(node, result, numThreads);
                    }
                    else
                    {
                        ComputeParallelSufficientThreads(node, result, numThreads);
                    }

                    node.DisposeChildren();
                    node.DisposeDescendants();
                }
            }
        }