Ejemplo n.º 1
0
        private static void FillPar(this byte[] arrayToFill, byte value, int startIndex, int length)
        {
            int m = length / 2;
            int lengthOf2ndHalf = length - m;

            Parallel.Invoke(
                () => { Algorithm.Fill(arrayToFill, value, startIndex, m); },
                () => { Algorithm.Fill(arrayToFill, value, startIndex + m, lengthOf2ndHalf); }
                );
        }
Ejemplo n.º 2
0
        public static void FillPar <T>(this T[] arrayToFill, T value, int startIndex, int length) where T : struct
        {
            int m = length / 2;
            int lengthOf2ndHalf = length - m;

            Parallel.Invoke(
                () => { Algorithm.Fill <T>(arrayToFill, value, startIndex, m); },
                () => { Algorithm.Fill <T>(arrayToFill, value, startIndex + m, lengthOf2ndHalf); }
                );
        }
Ejemplo n.º 3
0
        // TODO: Figure out why these are not scaling well
        private static void FillPar(this byte[] arrayToFill, byte value)
        {
            int m = arrayToFill.Length / 2;
            int lengthOf2ndHalf = arrayToFill.Length - m;

            Parallel.Invoke(
                () => { Algorithm.Fill(arrayToFill, value, 0, m); },
                () => { Algorithm.Fill(arrayToFill, value, m, lengthOf2ndHalf); }
                );
        }
Ejemplo n.º 4
0
        public static void FillPar <T>(this T[] arrayToFill, T value) where T : struct
        {
            int m = arrayToFill.Length / 2;
            int lengthOf2ndHalf = arrayToFill.Length - m;

            Parallel.Invoke(
                () => { Algorithm.Fill <T>(arrayToFill, value, 0, m); },
                () => { Algorithm.Fill <T>(arrayToFill, value, m, lengthOf2ndHalf); }
                );
        }