Example #1
0
        protected Driver(string inputPath, string outputPath)
        {
            SourceFile = inputPath;
            ResultFile = outputPath;

            _readQueue = new SyncronizedQueue <byte[]>();
            WriteQueue = new SyncronizedQueue <byte[]>();

            _threadPool = new MyThreadPool();
        }
Example #2
0
        private void buttonCreatePool_Click(object sender, EventArgs e)
        {
            int min = 0, max = 0;

            try
            {
                min = Int32.Parse(textBoxMin.Text);
                max = Int32.Parse(textBoxMax.Text);

                if (min > max || min <= 0)
                {
                    throw new Exception("Значения введены неверно");
                }

                ShowTasksMenu();

                threadPool = new MyThreadPool(min, max);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #3
0
 public static void Execute(this IMyThreadPool pool)
 {
     pool.Run();
     pool.Wait();
 }