improved thread creation for producer