dukus / digiCamControl

DSLR camera remote control open source software
http://digicamcontrol.com/
Other
675 stars 226 forks source link

Contribute to Virtual WebCam? #353

Open johnterickson opened 4 years ago

johnterickson commented 4 years ago

@dukus I know this #349 is closed but I am interested in contributing some performance optimizations (if I can find any!) for digiCamControl Virtual Webcam but I can't find any references to DSLRCam.exe. The PDB refers to bitmapbroadcaster.cs which I don't see in this repo.

johnterickson commented 4 years ago

Turns out I was able to mitigate the perf issue by setting COMPlus_SpinRetryCount equal to 0.

The problem is that the "GetLiveView" keep piling up and it eats more and more threads and then more and more threads are spinning on the lock.

johnterickson commented 4 years ago

I think you'll want to change from

lock(x)
{
 x.DoStuff()
}

to


if (Monitor.TryEnter(x)) {
  try { x.DoStuff(); } finally { Monitor.Leave(x); }
}