| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Parallel collections now use `scala.concurrent.ExecutionContext`
by default.
The `ExecutionContextTaskSupport` is optimized to use the
`ForkJoinPool` underlying the `ExecutionContext` if possible.
Otherwise, a fallback `TaskSupport` that creates a reduction tree and
execute an operation through `Future`s is used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One last flurry with the broom before I leave you slobs to code
in your own filth. Eliminated all the trailing whitespace I
could manage, with special prejudice reserved for the test cases
which depended on the preservation of trailing whitespace.
Was reminded I cannot figure out how to eliminate the trailing
space on the "scala> " prompt in repl transcripts. At least
reduced the number of such empty prompts by trimming transcript
code on the way in.
Routed ConsoleReporter's "printMessage" through a trailing
whitespace stripping method which might help futureproof
against the future of whitespace diseases. Deleted the up-to-40
lines of trailing whitespace found in various library files.
It seems like only yesterday we performed whitespace surgery
on the whole repo. Clearly it doesn't stick very well. I suggest
it would work better to enforce a few requirements on the way in.
|
|
|
|
|
|
|
|
| |
Partest uses test-interface API to invoke ScalaCheck. This obviates
ad hoc output checking for result status.
The context class loader is set to a loader that the scaladoc scalacheck
tests can use.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reverts part of c82ecab. The parser can't assume that
a pattern `(a, b)` will match, as results of
`.isInstanceOf[Tuple2]` can't be statically known until
after the typer.
The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing
this regression SI-6968. Keeping all of those fixed will require
a better definition of irrefutability, and some acrobatics to
ensure safe passage to the ambiguous trees through typechecking.
|
|
|
|
|
|
|
|
| |
Introduced the collection.concurrent package and introduced the
concurrent.Map trait there. Deprecated the mutable.ConcurrentMap trait.
Pending work - introduce the appropriate changes to JavaConversions
and JavaConverters.
|
| |
|
|
|
|
|
|
|
|
|
| |
This required a bit of refactoring in the tasks objects and implementations
of various operations. Combiners now hold a reference to a tasksupport
object and pass it on to their result if `resultWithTaskSupport` is called.
Additionally, several bugs that have to do with CanBuildFrom and combiner
resolution have been fixed.
|
|
|
|
| |
Changed parameters in some tests to speed them up.
|
|
|
|
|
|
|
|
|
|
| |
This is part of an effort to make the immutable collections
(more) thread safe. The `::` still has non-final member fields
for head and tail, but there is not much that can be done right
now about that, since these fields are used by list buffers.
Tried writing a test with unsafe initialization, but could not
invent a scenario which actually fails, at least on the JDK6.
|
| |
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Refactoring the collections api to support differentiation between
referring to a sequential collection and a parallel collection, and to
support referring to both types of collections.
New set of traits Gen* are now superclasses of both their * and Par* subclasses. For example, GenIterable is a superclass of both Iterable and ParIterable. Iterable and ParIterable are not in a subclassing relation. The new class hierarchy is illustrated below (simplified, not all relations and classes are shown):
TraversableOnce --> GenTraversableOnce
^ ^
| |
Traversable --> GenTraversable
^ ^
| |
Iterable --> GenIterable <-- ParIterable
^ ^ ^
| | |
Seq --> GenSeq <-- ParSeq
(the *Like, *View and *ViewLike traits have a similar hierarchy)
General views extract common view functionality from parallel and
sequential collections.
This design also allows for more flexible extensions to the collections
framework. It also allows slowly factoring out common functionality up
into Gen* traits.
From now on, it is possible to write this:
import collection._
val p = parallel.ParSeq(1, 2, 3)
val g: GenSeq[Int] = p // meaning a General Sequence
val s = g.seq // type of s is Seq[Int]
for (elem <- g) {
// do something without guarantees on sequentiality of foreach
// this foreach may be executed in parallel
}
for (elem <- s) {
// do something with a guarantee that foreach is executed in order, sequentially
}
for (elem <- p) {
// do something concurrently, in parallel
}
This also means that some signatures had to be changed. For example,
method `flatMap` now takes `A => GenTraversableOnce[B]`, and `zip` takes
a `GenIterable[B]`.
Also, there are mutable & immutable Gen* trait variants. They have
generic companion functionality.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implementing foreach to work in parallel in ParIterableLike.
Doing a bunch of refactoring around in the collection framework to
ensure a parallel foreach is never called with a side-effecting method.
This still leaves other parts of the standard library and the compiler
unguarded.
No review.
|
|
|
|
|
|
|
| |
Fixes the broken test, introduced in the view patch commit.
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all view classes now list parents like
trait Appended[B >: A] extends super.Appended[B] with Transformed[B]
instead of the former
trait Appended[B >: A] extends Transformed[B] with super.Appended[B]
because as it was, the implementation of foreach in
TraversableViewLike#Transformed was repeatedly trumping overrides found
in e.g. IterableLike. This change was not without its own consequences,
and much of the rest of the patch is dealing with that. A more general
issue is clearly revealed here: there is no straightforward way to deal
with trait composition and overrides when some methods should prefer B
over A and some the reverse. (It's more like A through Z in this case.)
That closes #4279, with some views being five orders of magnitude slower
than necessary. There is a test that confirms they'll stay performance
neighbors.
In the view classes (Zipped, Mapped, etc.) I attended to them with
comb and brush until they were reasonably consistent. I only use
"override" where necessary and throw in some "final" in the interests
of trying to anchor the composition outcome. I also switched the
newSliced, newZipped, etc. methods to use early init syntax since a
number have abstract vals and I found at least one bug originating with
uninitialized access.
There was a piece of a parallel collections scalacheck test failing,
which
I disabled out of expedience - am emailing prokopec.
There is plenty of work left to do but paulp must get back to other 2.9
issues. This is the Zurich->SF airplane patch. No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
| |
Implemented a (slower) workaround for parallel vectors. Implemented
group by.
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
|
| |
Array combiners implementation changed from array buffers to doubling
unrolled buffers to avoid excessive copying. Still evaluating the
benefits of this.
No review.
|
|
|
|
|
|
|
|
|
|
| |
Fixed parallel ranges to use the same range logic under the hood, and
not introduce code duplication.
Slight fix in Tasks.
No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Special cased with thread pool executor scheduling. Fixed an ugly
concurrency bug where futures returned by a thread pool executor didn't
remove the task from the queue when cancel was called. Note to self and
others: don't cancel futures returned by thread pool executors, it might
lead to unexpected behaviour. Modified the executor to add new threads
if all the active threads are syncing, in order to avoid deadlocks.
Fixed a hidden bug in AdaptiveWorkStealingTasks, where correct behaviour
depended on the execution order of the tasks. This didn't fail before
with ForkJoinTasks, since there the execution order is well-defined.
Scalachecked 1.5 & 1.6 support.
No review.
|
|
|
|
|
|
|
|
| |
Refactored parallel collections for pluggable task support
implementations.
No review.
|
|
|
|
|
| |
No review
|
|
|
|
|
|
|
|
|
|
|
| |
Added parallel mutable hash sets.
Implemented parallel mutable hash set iterators.
Implemented parallel mutable hash set combiners.
Factored out unrolled linked lists into a separate class UnrolledBuffer, added tests.
Added parallel mutable hash set tests, and debugged hashsets.
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
| |
Mostly refactored existing test functionality for parallel collections.
Added immutable hash set tests.
No review.
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
| |
Plus one wild goose chase and test fixes.
No review.
|
|
|
|
|
|
|
|
| |
Some exception handling fixes in parallel collections. Fixed some
regressions. Fixed some tests.
No review.
|
| |
|
| |
|
|
|
|
|
|
| |
Disabling a test from last commit until figuring out why it fails on the
server. No review
|
|
|
|
|
| |
An issue with scalacheck and actors where an excess of thread pools gets created - tmp fix. No review.
|
|
|
|
|
|
|
| |
Fixed a scalacheck test group "test entire subdirectory" problem. It's
now possible to add scalacheck tests consisting of multiple files. No
review.
|
|
|
|
|
|
|
| |
Temporarily disabled collections checks to keep build from breaking.
No review
|
|
Review by phaller (not urgent).
|