> So, I made spinlocks "fair" by revision 5274. This means that no
> threads get *lost* on scheduling, if lock is requested.
>
> Please give this version a try.
I have tried it, thanks for the patch!
Unfortunately it appears that (ffmpeg + libx264 using it at least)
appears to deadlock (?) after a few seconds.
Here's an example trace:
Thanks for your help in this!
-roger-
[New Thread 5056.0xcc4]9.0 size= 0kB time=00:00:00.06 bitrate=
0.0kbits/s dup=3 drop=0
Program received signal SIGINT, Interrupt.
[Switching to Thread 5056.0xcc4]
0x767c6d67 in NlsUpdateSystemLocale () from C:\Windows\syswow64\kernel32.dll
(gdb) thread apply all bt
Thread 10 (Thread 5056.0xcc4):
#0 0x767c6d67 in NlsUpdateSystemLocale () from C:\Windows\syswow64\kernel32.dll
#1 0x7b21c13a in ?? ()
#2 0x00000000 in ?? ()
Thread 8 (Thread 5056.0xa6c):
#0 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#1 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#2 0x75640bdd in WaitForMultipleObjectsEx () from
C:\Windows\syswow64\KernelBase.dll
#3 0x00000002 in ?? ()
#4 0x07dffd28 in ?? ()
#5 0x76721a2c in KERNEL32!GetVolumePathNamesForVolumeNameA () from
C:\Windows\syswow64\kernel32.dll
#6 0x07dffd28 in ?? ()
#7 0x76724208 in KERNEL32!CheckForReadOnlyResource () from
C:\Windows\syswow64\kernel32.dll
#8 0x00000002 in ?? ()
#9 0x7efde000 in ?? ()
#10 0x00bb46c8 in do_sema_b_wait_intern (sema=0x1fc, nointerrupt=0,
timeout=4294967295) at src/cond.c:599
#11 0x00bb49dc in do_sema_b_wait (sema=0x1fc, nointerrupt=0,
timeout=4294967295, cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:559
#12 do_sema_b_wait (sema=0x1fc, nointerrupt=0, timeout=4294967295,
cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:549
#13 0x00bb4dfa in pthread_cond_wait (c=0x3cbdb64,
external_mutex=0x3cbdb68) at src/cond.c:448
#14 0x00827fa0 in worker (v=0x3cbf060) at libavcodec/pthread.c:216
#15 0x00bb62f8 in pthread_create_wrapper (args=0x6e26eb8) at src/thread.c:1378
#16 0x75571287 in msvcrt!_itow_s () from C:\Windows\syswow64\msvcrt.dll
#17 0x75571328 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#18 0x7672339a in KERNEL32!BaseCleanupAppcompatCacheSupport () from
C:\Windows\syswow64\kernel32.dll
#19 0x06e26f90 in ?? ()
#20 0x777e9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#21 0x06e26f90 in ?? ()
#22 0x777e9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#23 0x755712e5 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#24 0x00000000 in ?? ()
Thread 7 (Thread 5056.0x1638):
#0 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#1 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#2 0x75640bdd in WaitForMultipleObjectsEx () from
C:\Windows\syswow64\KernelBase.dll
#3 0x00000002 in ?? ()
#4 0x07bffd28 in ?? ()
#5 0x76721a2c in KERNEL32!GetVolumePathNamesForVolumeNameA () from
C:\Windows\syswow64\kernel32.dll
#6 0x07bffd28 in ?? ()
#7 0x76724208 in KERNEL32!CheckForReadOnlyResource () from
C:\Windows\syswow64\kernel32.dll
#8 0x00000002 in ?? ()
#9 0x7efde000 in ?? ()
#10 0x00bb46c8 in do_sema_b_wait_intern (sema=0x1fc, nointerrupt=0,
timeout=4294967295) at src/cond.c:599
#11 0x00bb49dc in do_sema_b_wait (sema=0x1fc, nointerrupt=0,
timeout=4294967295, cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:559
#12 do_sema_b_wait (sema=0x1fc, nointerrupt=0, timeout=4294967295,
cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:549
#13 0x00bb4dfa in pthread_cond_wait (c=0x3cbdb64,
external_mutex=0x3cbdb68) at src/cond.c:448
#14 0x00827fa0 in worker (v=0x3cbf060) at libavcodec/pthread.c:216
#15 0x00bb62f8 in pthread_create_wrapper (args=0x6e26bb0) at src/thread.c:1378
#16 0x75571287 in msvcrt!_itow_s () from C:\Windows\syswow64\msvcrt.dll
#17 0x75571328 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#18 0x7672339a in KERNEL32!BaseCleanupAppcompatCacheSupport () from
C:\Windows\syswow64\kernel32.dll
#19 0x06e26c88 in ?? ()
#20 0x777e9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#21 0x06e26c88 in ?? ()
#22 0x777e9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#23 0x755712e5 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#24 0x00000000 in ?? ()
Thread 6 (Thread 5056.0x16ac):
#0 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#1 0x777d013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
from C:\Windows\system32\ntdll.dll
#2 0x75640bdd in WaitForMultipleObjectsEx () from
C:\Windows\syswow64\KernelBase.dll
#3 0x00000002 in ?? ()
#4 0x079ffd28 in ?? ()
#5 0x76721a2c in KERNEL32!GetVolumePathNamesForVolumeNameA () from
C:\Windows\syswow64\kernel32.dll
#6 0x079ffd28 in ?? ()
#7 0x76724208 in KERNEL32!CheckForReadOnlyResource () from
C:\Windows\syswow64\kernel32.dll
#8 0x00000002 in ?? ()
#9 0x7efde000 in ?? ()
#10 0x00bb46c8 in do_sema_b_wait_intern (sema=0x1fc, nointerrupt=0,
timeout=4294967295) at src/cond.c:599
#11 0x00bb49dc in do_sema_b_wait (sema=0x1fc, nointerrupt=0,
timeout=4294967295, cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:559
#12 do_sema_b_wait (sema=0x1fc, nointerrupt=0, timeout=4294967295,
cs=0x6e267c4, val=0x6e267dc)
at src/cond.c:549
#13 0x00bb4dfa in pthread_cond_wait (c=0x3cbdb64,
external_mutex=0x3cbdb68) at src/cond.c:448
#14 0x00827fa0 in worker (v=0x3cbf060) at libavcodec/pthread.c:216
#15 0x00bb62f8 in pthread_create_wrapper (args=0x6e268a8) at src/thread.c:1378
#16 0x75571287 in msvcrt!_itow_s () from C:\Windows\syswow64\msvcrt.dll
#17 0x75571328 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#18 0x7672339a in KERNEL32!BaseCleanupAppcompatCacheSupport () from
C:\Windows\syswow64\kernel32.dll
#19 0x06e26980 in ?? ()
#20 0x777e9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#21 0x06e26980 in ?? ()
#22 0x777e9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#23 0x755712e5 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll
#24 0x00000000 in ?? ()
Thread 5 (Thread 5056.0x1824):
#0 0x777cfd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1 0x756431bb in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2 0x00000000 in ?? ()
Thread 4 (Thread 5056.0x1734):
#0 0x777cfd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1 0x756431bb in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2 0x00000000 in ?? ()
Thread 3 (Thread 5056.0x11b0):
#0 0x777cfd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1 0x756431bb in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2 0x00000000 in ?? ()
Thread 2 (Thread 5056.0x9f4):
#0 0x777cfd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1 0x756431bb in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2 0x00000000 in ?? ()
Thread 1 (Thread 5056.0x1650):
#0 0x777cfd71 in ntdll!RtlFindSetBits () from C:\Windows\system32\ntdll.dll
#1 0x756431bb in SleepEx () from C:\Windows\syswow64\KernelBase.dll
#2 0x00000000 in ?? ()
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public