Changeset 66650

Timestamp:
Nov 20, 2010, 12:15:41 AM (12 years ago)
Author:
Noel Belcourt
Message:

Fix poor parallel throughput on larger SMP systems.

When select() returns with data on one or more file descriptors,
we use fread() to read data from the live descriptors. The problem
is that these are blocking file descriptors so most of the time
bjam is waiting, it's actually waiting in fread(), rather than
waiting in select().

There are two possible patches: one is to just call fread() a single
time (not inside a loop) or we can make the file descriptors non-
blocking. It's more efficient to make the descriptors non-blocking
as this allows us to read all data on a descriptor each time select()
returns. The first approach would not permit us to read all the data
on a descriptor (only as much as fits into our buffer).

I tested this patch on Suse, Redhat, and Darwin.

(No files)

Note: See TracChangeset for help on using the changeset viewer.