A multi-threaded processor adapted to couple to external memory comprises
a controller and data storage operated by the controller. The data
storage comprises a first portion and a second portion, and wherein only
one of the first or second portions is active at a time, the non-active
portion being unusable. When the active portion does not have sufficient
capacity for additional data to be stored therein, the other portion
becomes the active portion. Upon a thread switch from a first thread to a
second thread, only one of the first or second portions is cleaned to the
external memory if one of the first or second portions does not contain
valid data.