title: How is thread context switching done?
body: <p>As I understand that in process context switching the OS 'backups' the registers and instruction pointer (also part of register).</p>
  
  <p>But in case of switching among threads within a process will the OS take backup of the full register memory and stack?</p>
  
  <p>The reason I ask this is to understand if the <em>volatile</em> keyword of Java is of any significance in case of single core processors.</p>