how can you measure the time spent in a context switch under java platform

Viewed 7991

Let's assume each thread is doing some FP calculation, I am interested in

  • how much time the CPU is used in switching threads instead of running them
  • how much synchronization traffic is created on shared memory bus - when threads share data, they must use synchronization mechanism

My question: how to design a test program to get this data?

3 Answers
Related