Spin locks causing hanging #41
A problem on Drobo NAS was reported. The program was sometimes hanging during par-repair when multithreading par-repair was active (option ParThreads).
The spin locks are alternative to mutexes and can provide performance gain in certain situations. In NZBGet spin locks are used only in two cases:
Spin locks can be always replaced by mutexes. Furthermore not all platforms support spin locks (for example Mac OS X doesn't and not every Linux system has them). NZBGet uses spin locks if available, otherwise it falls back to mutexes.
Steps to reproduce
Although the problem was initially reported during par-repair the easier way to reproduce is:
If the system has problem with spin locks the download will soon stop.
Made tests on a Linux box with mipsel CPU (2x400MHz). Don't see any performance gain when using spin locks. Quite the contrary- the mutex version downloads even faster.
@ftischhauser: could you please make a test on Windows?
Are there any difference? Which is better?