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

Add Scala.js and Scala Native artifacts that have serial behavior? #251

Open
SethTisue opened this issue Sep 18, 2023 · 5 comments
Open

Comments

@SethTisue
Copy link
Member

SethTisue commented Sep 18, 2023

as suggested by @JD557

Pros:

  • Convenient for folks who are crossbuilding
  • If we add this library to the Toolkit, as I've suggested at Include parallel collections in Toolkit? toolkit#31 , there is a usual expectation that included libraries are cross-platform. Though we've already included os-lib regardless, which is major precedent

Cons:

  • Non-JVM users might be surprised to have their .par using code compile but not get any actual parallelism
    • If we're concerned about this, I suppose we could print a runtime warning to stderr, then provide an API call to suppress the warning
@JD557
Copy link

JD557 commented Sep 18, 2023

I haven't tested this, but I think a simple solution might be to just change

val defaultTaskSupport: TaskSupport = new ExecutionContextTaskSupport
to use parasitic on native and js.

At least I think with that EC Await.result will work on both native and js.

@SethTisue
Copy link
Member Author

At least I think with that EC Await.result will work on both native and js

@sjrd agree?

@sjrd
Copy link
Member

sjrd commented Sep 18, 2023

Await.result will never link on Scala.js. It doesn't matter what execution context you use. Await.result has the potential to synchronously wait, so it won't link, period.

@WojciechMazur
Copy link

With the Scala Native 0.5.0 it would be beneficial to support Scala Native artifacts. With the added multithreading support there should be no issues with using parallel collections and scala.collection.concurrent It is already tested based on Scala 2.12 Junit partests for almost a year now: scala-native/scala-native#3149

@SethTisue
Copy link
Member Author

Wow, cool! Yes, a PR on that would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants