My multi thread patch val

This is the patch for multi-threading as requested by:
https://indico.cern.ch/getFile.py/access?contribId=0&resId=0&materialId=slides&confId=226739