public void CallMultithreadedMethod(CustomMultithreads cmt, object item)
        {
            try
            {
                lock (lockr_PoolThreads)
                {
                    if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                    {
                        lock (lockr_PoolThreads)
                        {
                            Monitor.Wait(lockr_PoolThreads);

                            if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                            {
                                Monitor.Wait(lockr_PoolThreads);
                            }
                        }
                    }
                }
                cmt.StartSingleMultithreadedMethod(item);
                Thread.Sleep(500);
            }
            catch (Exception ex)
            {
            }
        }
        public void CallMultithreadedMethod(CustomMultithreads cmt, object item)
        {
            try
            {
                //cmt.threadStartedEvent.processCompletedEvent += new EventHandler(threadStartedEvent_processCompletedEvent);
                //cmt.threadCompletedEvent.processCompletedEvent += new EventHandler(threadCompletedEvent_processCompletedEvent);
                lock (lockr_PoolThreads)
                {
                    if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                    {
                        lock (lockr_PoolThreads)
                        {
                            Monitor.Wait(lockr_PoolThreads);

                            if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                            {
                                Monitor.Wait(lockr_PoolThreads);
                            }
                        }
                    }
                }
                cmt.StartSingleMultithreadedMethod(item);
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);
            }
        }
        public void CallMultithreadedMethod(CustomMultithreads cmt, object item)
        {
            try
            {
                //cmt.threadStartedEvent.processCompletedEvent += new EventHandler(threadStartedEvent_processCompletedEvent);
                //cmt.threadCompletedEvent.processCompletedEvent += new EventHandler(threadCompletedEvent_processCompletedEvent);
                lock (lockr_PoolThreads)
                {
                    if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                    {
                        lock (lockr_PoolThreads)
                        {
                            Monitor.Wait(lockr_PoolThreads);

                            if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                            {
                                Monitor.Wait(lockr_PoolThreads);
                            }
                        }
                    }
                }
                cmt.StartSingleMultithreadedMethod(item);

               
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error(" Error : " + ex.StackTrace);

            }


        }
        public void CallMultithreadedMethod(CustomMultithreads cmt, object item)
        {
            try
            {
               
                lock (lockr_PoolThreads)
                {
                    if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                    {
                        lock (lockr_PoolThreads)
                        {
                            Monitor.Wait(lockr_PoolThreads);

                            if (counterWorkerThreadsInPool >= maxNoOfThreadsInPool)
                            {
                                Monitor.Wait(lockr_PoolThreads);
                            }
                        }
                    }
                }
                cmt.StartSingleMultithreadedMethod(item);
                Thread.Sleep(500);

               
            }
            catch (Exception ex)
            {
              

            }


        }