protected synchronized void buildClassifiers(final Instances data) throws Exception {

    for (int i = 0; i < m_Classifiers.length; i++) {
      if (m_numExecutionSlots > 1) {
        final Classifier currentClassifier = m_Classifiers[i];
        final int iteration = i;
        Runnable newTask = new Runnable() {
          public void run() {
            try {
              if (m_Debug) {
                System.out.println("Training classifier (" + (iteration +1) + ")");
              }
              currentClassifier.buildClassifier(data);
              if (m_Debug) {
                System.out.println("Finished classifier (" + (iteration +1) + ")");
              }
              completedClassifier(iteration, true);
            } catch (Exception ex) {
              ex.printStackTrace();
              completedClassifier(iteration, false);
            }
          }
        };

        // launch this task
        m_executorPool.execute(newTask);
      } else {
        m_Classifiers[i].buildClassifier(data);
      }
    }

    if (m_numExecutionSlots > 1 && m_completed + m_failed < m_Classifiers.length) {
      block(true);
    }
  }