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(); } }
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 (); } }
public QueryWorkerClosure (IQueryWorker _worker, QueryResult _result) { worker = _worker; result = _result; }
public QueryWorkerClosure(IQueryWorker _worker, QueryResult _result) { worker = _worker; result = _result; }