1. A computer-implemented method for thread-based cache content saving for task switching in a computer processor, the method comprising: based on a task switch in the computer processor from a first thread to a second thread: determining a cache entry in a cache of the computer processor that is owned by the first thread, wherein the determination is made based on a hardware thread identifier (ID) of the first thread matching a hardware thread ID in the cache entry; wherein the hardware thread ID of the first thread comprises an index of a software thread ID of the first thread in a thread ID table of the computer processor, and wherein the thread ID table comprises a list of software thread IDs corresponding to most recently executed threads in the computer processor, wherein each software thread ID in the thread ID table has a corresponding respective index in the thread ID table that comprises a hardware thread ID of a thread corresponding to the software thread ID; determining whether the determined cache entry is eligible for prefetching; and based on determining that the determined cache entry is eligible for prefetching, setting a marker in the cache entry to active.