5

I'm currently having problems with the contention rate of a partical application (.net 4.0, c#) I'm maintaining. What I would like to do is to write a PerfCounter if one partical lock couldn't be aquired. Right now I just have the overall counter, provided by .net, but I would like to have a PerfCounter for some selected locks.

Profiler etc. is not a option for me, as this is a high performing productive environment that I cannot touch, I can record perfcounters.

svick
  • 236,525
  • 50
  • 385
  • 514
Martin Moser
  • 6,219
  • 1
  • 27
  • 41
  • 5
    That's not going to fly, you can't just bolt a perf counter onto a lock. You really do need a profiler, the concurrency visualizer in VS Ultimate will do nicely. You'll need to fix the 'cannot touch' problem first. Create a simulated runtime environment with fake data. – Hans Passant Mar 07 '12 at 11:29

1 Answers1

2

ETW events may already provide information on what you need. See ETW overview and Lock contention.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179