[driver] Rework the Unix implementation of TaskQueue::execute() to support reading from pipes as they fill, instead of all at once at the end.

Instead of always calling waitpid() and looking for the termination of a task, call poll() and watch for events on the pipes which are used for buffering subtask output. When we receive a POLLIN or POLLPRI event, ask the corresponding Task to read from the pipe; when we receive a POLLHUP or POLLERR event, wait for the subtask to finish and then ask the Task to perform its post-execution tasks.

Now that the Unix implementation properly handles large amounts of subtask output, re-enable the Unix implementation (if supported).

This fixes <rdar://problem/15795234>.

Swift SVN r12293
This commit is contained in:
Connor Wakamo
2014-01-14 20:39:23 +00:00
parent b2f60a38ed
commit cc00fd1048
2 changed files with 132 additions and 59 deletions

View File

@@ -23,9 +23,7 @@ using namespace swift;
using namespace swift::sys;
// Include the correct TaskQueue implementation.
// TODO: re-enable Unix implementation once output buffering works correctly
// (<rdar://problem/15795234>).
#if 0 && LLVM_ON_UNIX
#if LLVM_ON_UNIX
#include "Unix/TaskQueue.inc"
#else
#include "Default/TaskQueue.inc"