Skip to main content
The 2024 Developer Survey results are live! See the results
edited tags
Link
axel22
  • 32.2k
  • 9
  • 126
  • 139
Clarified
Source Link
csvan
  • 9.2k
  • 12
  • 52
  • 93

I am relatively new toDoes Scala. I was wondering if the standard library provides provide a way to perform a distributedexecute parallel map operationoperations as part of the standard language?

For example, given:

scala> val a = List((1,2), (3,4), (3,6))
a: List[(Int, Int)] = List((1,2), (3,4), (3,6))

I can do:

scala> a.map(tup => tup._1 + tup._2)
res0: List[Int] = List(3, 7, 9)

However, to the best of my knowledge this maps the provided function over the list objects sequentially. Is there a built-in way to have the function applied to each element in a separate thread (or equivalent), and the results then gathered into a resulting list?

I am relatively new to Scala. I was wondering if the standard library provides a way to perform a distributed map operation?

For example, given:

scala> val a = List((1,2), (3,4), (3,6))
a: List[(Int, Int)] = List((1,2), (3,4), (3,6))

I can do:

scala> a.map(tup => tup._1 + tup._2)
res0: List[Int] = List(3, 7, 9)

However, to the best of my knowledge this maps the provided function over the list objects sequentially. Is there a built-in way to have the function applied to each element in a separate thread (or equivalent), and the results then gathered into a resulting list?

Does Scala provide a way to execute parallel map operations as part of the standard language?

For example, given:

scala> val a = List((1,2), (3,4), (3,6))
a: List[(Int, Int)] = List((1,2), (3,4), (3,6))

I can do:

scala> a.map(tup => tup._1 + tup._2)
res0: List[Int] = List(3, 7, 9)

However, to the best of my knowledge this maps the provided function over the list objects sequentially. Is there a built-in way to have the function applied to each element in a separate thread (or equivalent), and the results then gathered into a resulting list?

distributed is many-machines-wide, not splitting the workload between threads
Link
om-nom-nom
  • 62.7k
  • 13
  • 185
  • 230

Distributed Parallel map operations?

Source Link
csvan
  • 9.2k
  • 12
  • 52
  • 93
Loading