Rune - Threading fixes, cleanups
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Mar 2018 06:31:02 +0000 (22:31 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 2 Mar 2018 07:03:27 +0000 (23:03 -0800)
commitf718cec407405b364332193b0049d8cf747e7b63
tree2b4d80fdd3ad4f92199601de6ff6599f0218e9ab
parent09aaa042f40ad55b5bc875fb3bef062fc0b29c68
Rune - Threading fixes, cleanups

* Implement importdesc().  This sets O_NONBLOCK on the descriptor when
  extpread()/extpwrite() are not available.

* Cleanup the Stream and StreamPair class a bit.  Separate the allocation
  for the read and write streams in StreamPair.  This allows accessors to
  separately thread the read and write side without deadlocking each other.

* Fix per-rgd TaskReadAry and TaskWriteAry handling.  Recent threading
  changes now allow all rgd's to maintain their own KQueue.

* Preallocate the array of lists instead of having an array of pointers
  for TaskReadAry and TaskWriteAry.  Its just easier, and the size of
  the array is dynamic anyway (based on number of descriptors).

* Implement I/O support on systems which do not have extpread() and
  extpwrite().

* Fix RunThreads accounting.

* Fix threadPushRunnable() use cases.

* Remove a bunch of LASTQUEUE related debugging.
13 files changed:
classes/stdio/file.d
classes/sys/fd.d
classes/sys/stream.d
libgen/syscalls.c
libruntime/event.c
libruntime/sys_fd.c
libruntime/sys_thread.c
libruntime/syscalls.h
libruntime/thread.c
libruntime/thread.h
tests/pipe1.d
tests/threadov.d
tests/ttest.c