A method, computer-readable medium, and apparatus for context switching
between a first thread and a second thread. The method includes detecting
an exception, wherein the exception is generated in response to receiving
a packet of information directed to one of the first thread and the
second thread, and in response to detecting the exception, invoking an
exception handler. The exception handler is configured to execute one or
more instructions removing access to at least a portion of a processor
cache. The portion of the processor cache contains cached information for
the first thread using a first address translation. Removing access to
the portion of the processor cache prevents the second thread using a
second address translation from accessing the cached information in the
processor cache. The exception handler is also configured to branch to at
least one of the first thread and the second thread.