Long-running tasks inhibit a parallel execution in some cases. A finer task granularity can significantly improve execution times in parallel environment.
That is even more significant when using cooperative scheduling and it puts higher requirements on user code. In this paper we present a method of user code optimization using static code analysis in order to reduce long-running tasks.
The method is based on evaluation of runtime code complexity and yielding a task execution in an appropriate place.