scala / scala-parallel-collections

Parallel collections standard library module for Scala 2.13+
Apache License 2.0
199 stars 29 forks source link

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

Open SethTisue opened 11 months ago

SethTisue commented 11 months ago

as suggested by @JD557

Pros:

Cons:

JD557 commented 11 months ago

I haven't tested this, but I think a simple solution might be to just change https://github.com/scala/scala-parallel-collections/blob/ec2c34b6d9fb4cc6135cff502250738ed7f49e55/core/src/main/scala/scala/collection/parallel/package.scala#L39 to use parasitic on native and js.

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

SethTisue commented 11 months ago

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

@sjrd agree?

sjrd commented 11 months ago

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 commented 6 months ago

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: https://github.com/scala-native/scala-native/pull/3149

SethTisue commented 6 months ago

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