protected virtual _2DFractalHelper m_create_fractal_double_version(int width, int height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, width, height); Action <object> act = (abc) => { _m_create_part_of_fractal((AbcissOrdinateHandler)abc, fractal_helper); }; AbcissOrdinateHandler[] p_aoh = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Task[] ts = new Task[f_number_of_using_threads_for_parallel]; fractal_helper.GiveUnique(new RadianMatrix(width)); for (int i = 0; i < ts.Length; i++) { ts[i] = new Task(act, p_aoh[i]); ts[i].Start(); } for (int i = 0; i < ts.Length; i++) { ts[i].Wait(); } return(fractal_helper); }
protected override _2DFractal._2DFractalHelper m_create_fractal_double_version(int width, int height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, width, height); Action<object> act = (abc) => { _m_create_part_of_fractal((AbcissOrdinateHandler)abc, fractal_helper); }; AbcissOrdinateHandler[] p_aoh = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Task[] ts = new Task[f_number_of_using_threads_for_parallel]; FractalCloudPoints fcps=new FractalCloudPoints(_max_ammount_at_trace,new FractalCloudPoint[width/_abciss_step_length+(width%_abciss_step_length!=0?1:0)][][]); fractal_helper.GiveUnique(fcps); fractal_helper.GiveUnique(new RadianMatrix(width)); for (int i = 0; i < ts.Length; i++) { ts[i] = new Task(act, p_aoh[i]); ts[i].Start(); } for (int i = 0; i < ts.Length; i++) { ts[i].Wait(); } fcps.Clear(); return fractal_helper; }
protected override _2DFractal._2DFractalHelper m_create_fractal_double_version(int width, int height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, width, height); Action <object> act = (abc) => { _m_create_part_of_fractal((AbcissOrdinateHandler)abc, fractal_helper); }; AbcissOrdinateHandler[] p_aoh = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Task[] ts = new Task[f_number_of_using_threads_for_parallel]; FractalCloudPoints fcps = new FractalCloudPoints(_max_ammount_at_trace, new FractalCloudPoint[width / _abciss_step_length + (width % _abciss_step_length != 0?1:0)][][]); fractal_helper.GiveUnique(fcps); fractal_helper.GiveUnique(new RadianMatrix(width)); for (int i = 0; i < ts.Length; i++) { ts[i] = new Task(act, p_aoh[i]); ts[i].Start(); } for (int i = 0; i < ts.Length; i++) { ts[i].Wait(); } fcps.Clear(); return(fractal_helper); }
/*__________________________________________________________________Частные_методы_класса_____________________________________________________________*/ #region Private methods private _2DFractalHelper CreateFractalInParralels(int Width, int Height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, Width, Height); fractal_helper.GiveUnique(new double[Width][][]); Task[] tasks = new Task[f_number_of_using_threads_for_parallel]; AbcissOrdinateHandler[] aohs = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Action <object> act = (aoh) => { Create_part_of_fractal(fractal_helper, (AbcissOrdinateHandler)aoh); }; //fractal_helper.AOH.end_of_abciss = Width; //fractal_helper.AOH.end_of_ordinate = Height; // Create_part_of_fractal(fractal_helper, fractal_helper.AOH); for (int i = 0; i < tasks.Length; i++) { tasks[i] = new Task(act, aohs[i]); tasks[i].Start(); } for (int i = 0; i < tasks.Length; i++) { tasks[i].Wait(); tasks[i].Dispose(); } return(fractal_helper); }
protected virtual _2DFractalHelper inc_create_fractal(int width,int height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, width, height); Action<object> act = (abc) => { inc_create_part_of_fractal((AbcissOrdinateHandler)abc, fractal_helper); }; AbcissOrdinateHandler[] p_aoh = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Task[] ts = new Task[f_number_of_using_threads_for_parallel]; fractal_helper.GiveUnique(new RadianMatrix(width)); for (int i = 0; i < ts.Length; i++) { ts[i] = new Task(act, p_aoh[i]); ts[i].Start(); } for (int i = 0; i < ts.Length; i++) { ts[i].Wait(); } return fractal_helper; }
private _2DFractalHelper CreateFractalInParralels(int Width,int Height) { _2DFractalHelper fractal_helper = new _2DFractalHelper(this, Width, Height); fractal_helper.GiveUnique(new double[Width][][]); Task[] tasks = new Task[f_number_of_using_threads_for_parallel]; AbcissOrdinateHandler[] aohs = fractal_helper.CreateDataForParallelWork(f_number_of_using_threads_for_parallel); Action<object> act = (aoh) => { Create_part_of_fractal(fractal_helper, (AbcissOrdinateHandler)aoh); }; //fractal_helper.AOH.end_of_abciss = Width; //fractal_helper.AOH.end_of_ordinate = Height; // Create_part_of_fractal(fractal_helper, fractal_helper.AOH); for (int i = 0; i < tasks.Length;i++ ) { tasks[i] = new Task(act, aohs[i]); tasks[i].Start(); } for (int i = 0; i < tasks.Length;i++ ) { tasks[i].Wait(); tasks[i].Dispose(); } return fractal_helper; }