Task API for parallel programming