task: avoid task lock for each iteration