1. A computer implemented method for a prefetch threshold for cache restoration, the method comprising: determining, based on a task switch from an outgoing task to a current task in a processor, a prefetch threshold for a next task, the prefetch threshold corresponding to an expected runtime of the current task and an amount of time required to prefetch data for the next task; and starting prefetching for the next task while the current task is executing based on the prefetch threshold.