Factor pruneUnusedTypes. [reviewed by vass]

Factor pruneUnusedTypes() into three smaller functions: pruneUnusedClassTypes(),
pruneUnusedRefs() and changeDeadTypesToVoid().  

The first two actions were commingled in one loop, which required extra logic to
make sure that class types and their reference types were pruned together.  By
pruning unused class types first, the pruning of dead reference types becomes
simpler and more thorough: we only need to look for reference types whose
corresponding value types are already dead.

References to class types are preserved even if the reference types themselves
are dead, but dead references to non-class types are removed.  There is yet
another special case: _ref(dtNil) is preserved, as it is used during widening.

The third action is independent, so easily factored into its own function.

[tested in release/examples/]


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@22136 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Sync variable implementation: switch between using conditionals and spin waiting [reviewed by Greg]

Motivation: performance of the Computer Languages Game benchmark thread-ring was
extremely poor and varied depending on different task parallel strategies.  It 
was theorized that this had something to do with the implementation of
synchronization variables.

Upon analysis and experimentation, it was discovered that having the
implementation of sync variables adjust to the number of tasks created improved
the performance of thread-ring, as well as some other performance tests, and
reduced the difference in timing between the task parallel strategizes to
virtually non-existant.  Thus, when the number of tasks is greater than or equal
to the number of cores available, sync variables will now use condition
variables, and when the number of tasks is less than the number of cores
available, sync variables will spin and wait.  The former strategy is a
resurrection of an earlier implementation (see r18375 for when it was removed),
the latter is the most recent strategy, prior to this one.

In terms of files affected, only runtime/src/tasks/fifo/task-fifo.c shows the
switch between the two methods.  The remainder of the code added was an
adjustment of the previous implementation (pre r18375).  This adjustment
includes renaming of functions and types to reflect current practices, and the
movement of many functions from their original location in threads/pthreads/
to within tasks/fifo/.  This change was motivated by a discussion between Greg,
Brad, and myself on the utility of having separate tasking and threading
implementations.  It had been thought that doing so would allow for mixing and
matching between tasking and threading implementations, but in practice this has
not been as useful or as necessary as was originally thought.  Additionally,
were these implementations to be kept separate, the functionality I am
implementing in pthreads would need to be mirrored over to minimal or minimal
would be broken for fifo.  This was not a very attractive option for a number
of reasons, chief of which being the aforementioned utility of minimal as a fifo
threading option.  Thus, the code can now be found in tasks-fifo itself.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@22137 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Re-reverting qio.h as in r21705

r22135 contained a change to qio.h that had previously been attempted
in r21703, but which breaks the Mac OS X and linux32 builds.  I backed
it out that time, and am backing it out again here.




git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@22138 3a8e244f-b0f2-452b-bcba-4c88e055c3ca