Rune - Fix livelock on heavily contended locks
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 26 Mar 2018 00:48:43 +0000 (17:48 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 26 Mar 2018 01:02:46 +0000 (18:02 -0700)
commite45f5789f6033e8ff7f52438ae3d9df2756e0dba
tree03d012045ec3007fd41f693a85fa8a0b7067cf73
parent8536f56fdc9bae89a41555e31709df039b3855cc
Rune - Fix livelock on heavily contended locks

* Fix a livelock on heavily contended locks.  When waking up a list
  of blocked threads, a livelock situation can develop where the threads
  are placed back on the list asynchronously, preventing the iterator
  from ever being able to finish scanning the list.

* Fixed by issuing the wakeup in two passes.  The first pass moves td's
  to be woken up out of the list and onto a safe list.  The second pass
  wakes the tds up via the save list.

* Also fix Declaration layout (@rune_decl...), we added two fields.
TODO
libgen/backend_llvm.c
libgen/backend_ras.c
libruntime/lock.c
libruntime/thread.c