Preparation for context switches