Basic thread manager with kind-of resume and restart capabilities. Base for further research.