public Set<Binding> exec(List<Binding> intermediate) {
		List<RemoteService> services = triple.getServices();
		
		if(intermediate == null) {
			taskcounter = services.size();
			for(RemoteService rs:services) {
				WorkerPool pool = WorkerPool.getWorkerPool(rs);
				//addTask(pool,new QueryTask(this,rs));
				pool.submit(new QueryTask(this,rs));
			}
		}
		else {
			if(intermediate.isEmpty()) {
				return new HashSet<Binding>();
			}
			
			int interval = ParaConfig.blocksize;
			taskcounter = (int) (services.size()*(Math.ceil((double)intermediate.size()/interval)));
			int begin = 0;
			do {
				int end = begin + interval;
				end = Math.min(end, intermediate.size());
				List<Binding> sublist = intermediate.subList(begin, end);
				for(RemoteService rs:services) {
					WorkerPool pool = WorkerPool.getWorkerPool(rs);
					pool.submit(new BoundQueryTask(this,rs,sublist));
				}
				begin = end;
			}while(begin < intermediate.size());
		}
		try {
			synchronized (this) {
				this.wait();
			}
		} catch (InterruptedException e) {
			//e.printStackTrace();
			if(Config.debug)
				System.out.println(this+" is intrrupted.");
		}
		
		return results;
	}