Hi,
while Joel and I bootstrapped and tested Scala on Avian, we both encountered that the test suite hangs in test/files/scalacheck/parallel-collections.
This seems to be a Scala issue, Joel discovered that the same also happens on Hotspot when using ThreadPoolTaskSupport:
Nevermind, I figured it out. There's a lovely bit of code in
scala/collection/parallel/package.scala:
private[parallel] def getTaskSupport: TaskSupport =
if (scala.util.Properties.isJavaAtLeast("1.6")) {
val vendor = scala.util.Properties.javaVmVendor
if ((vendor contains "Oracle") || (vendor contains "Sun") || (vendor contains "Apple")) new ForkJoinTaskSupport
else new ThreadPoolTaskSupport
} else new ThreadPoolTaskSupport
If I change that to just
private[parallel] def getTaskSupport: TaskSupport = new ForkJoinTaskSupport
the parallel-collections test passes on Avian and HotSpot. However, if I
change it to
private[parallel] def getTaskSupport: TaskSupport = new ThreadPoolTaskSupport
it hangs on both Avian and HotSpot. In other words, the test simply won't
complete when using ThreadPoolTaskSupport, regardless of the VM, which
means the test can only pass if the VM vendor is Oracle, Sun, or Apple.
Ouch.
It looks like ThreadPoolTaskSupport is broken on all VMs.
Thread on the Avian mailing list:
https://groups.google.com/d/msg/avian/Hugny4JcnDw/shb3r-3BOR8JAn additional issue is that the reading out the vendor is not sufficient to determine whether a VM supports fork join.
Joel's thread dump is attached.
Thanks and bye,
Simon