data driven thread abstraction (phtread based)