public static void Write()
 {
     for (int i = 0 + 1; i < 8 + 1; i++)
     {
         Console.WriteLine("Producer writing... " + i);
         ar.Enqueue(i);
         Console.WriteLine("Producer write: " + i);
     }
 }
 private void LoadMaterial()
 {
     for (int i = 0; i < _productsCount; i++)
     {
         if (_cancelToken.IsCancellationRequested)
         {
             return;
         }
         _zero.Enqueue(new Product());
     }
 }
        private void AssemblyProduct(object cancelToken)
        {
            while (true)
            {
                //int threadIndex = (int)threadContext;
                //Console.WriteLine("thread Pack {0} started...", threadIndex);

                if (_cancelToken.IsCancellationRequested)
                {
                    return;
                }

                HardWork();// имитация сложной работы
                var product = _input.Dequeue();

                Make(product);

                PrintInformationAboutAssemblyShop(product.ToProductInfo());
                //Console.WriteLine("thread Pack {0} result calculated productId {1}...", threadIndex, product.Id);
                _output.Enqueue(product);
            }
        }