예제 #1
0
        public void AttachWorker(IQueryWorker worker)
        {
            lock (this) {
                if (cancelled)
                {
                    return;
                }

                QueryWorkerClosure qwc;
                qwc = new QueryWorkerClosure(worker, this);

                // QueryDriver has an enclosing WorkerStart,
                // so if we call WorkerStart in this thread,
                // all the workers will have a chance
                // to start before Finished is called

                if (!WorkerStartNoLock(worker))
                {
                    return;
                }

                // Run our queries serially rather than in
                // parallel with threads.  Since 98% of the
                // time indexes will be stored on the same disk
                // we gain nothing by parallelizing, even on
                // multiprocessor/multicore systems.
                //
                // This also reduces memory usage considerably.

                //ExceptionHandlingThread.Start (new ThreadStart (qwc.Start));
                qwc.Start();
            }
        }
예제 #2
0
		public void AttachWorker (IQueryWorker worker)
		{
			lock (this) {
				if (cancelled)
					return;

				QueryWorkerClosure qwc;
				qwc = new QueryWorkerClosure (worker, this);

				// QueryDriver has an enclosing WorkerStart,
				// so if we call WorkerStart in this thread, 
				// all the workers will have a chance 
				// to start before Finished is called
				
				if (!WorkerStartNoLock (worker)) 
					return;

				// Run our queries serially rather than in
				// parallel with threads.  Since 98% of the
				// time indexes will be stored on the same disk
				// we gain nothing by parallelizing, even on
				// multiprocessor/multicore systems.
				//
				// This also reduces memory usage considerably.

				//ExceptionHandlingThread.Start (new ThreadStart (qwc.Start));
				qwc.Start ();
			}
		}
예제 #3
0
			public QueryWorkerClosure (IQueryWorker _worker, QueryResult _result)
			{
				worker = _worker;
				result = _result;
			}
예제 #4
0
 public QueryWorkerClosure(IQueryWorker _worker, QueryResult _result)
 {
     worker = _worker;
     result = _result;
 }