Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ThreadPoolTaskSupport causes test to hang #7236

Closed
scabug opened this issue Mar 9, 2013 · 5 comments
Closed

Using ThreadPoolTaskSupport causes test to hang #7236

scabug opened this issue Mar 9, 2013 · 5 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Mar 9, 2013

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 an issue on Scala's side: 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:

{code}
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
{code}

If I change that to just
{code}
       private[parallel] def getTaskSupport: TaskSupport = new ForkJoinTaskSupport
{code}

the parallel-collections test passes on Avian and HotSpot. However, if I change it to

{code}
       private[parallel] def getTaskSupport: TaskSupport = new ThreadPoolTaskSupport
{code}

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-3BOR8J

Thread on the Scala mailing list: https://groups.google.com/d/msg/scala-internals/7N-7HzoH8tM/9mx4bZd4JfoJ

Joel's thread dump is attached.

I'll open a separate issue for the insufficient task support detection mechanism.

@scabug
Copy link
Author

@scabug scabug commented Mar 9, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7236?orig=1
Reporter: @soc
Affected Versions: 2.11.0-M1
Attachments:

@scabug
Copy link
Author

@scabug scabug commented Mar 13, 2013

@soc said:
IBM J9 also hangs with ThreadPoolTaskSupport.

@scabug
Copy link
Author

@scabug scabug commented Mar 13, 2013

@soc said:
Deprecate ThreadPoolTaskSupport and friends.

2.11: scala/scala#2251

@scabug
Copy link
Author

@scabug scabug commented Mar 20, 2013

@JamesIry said:
I'm leaving open for 2.12 to remind us to delete.

@scabug
Copy link
Author

@scabug scabug commented Jun 9, 2013

@soc said (edited on Jun 9, 2013 7:42:17 PM UTC):
Merged in scala/scala@27f3a89

I'm closing this, because I created an explicit new ticket for removals in 2.12: #7566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants