Open
Description
Parallel collections that use a fixed thread pool for task support and contain "too many" elements will deadlock, where "too many" is a value I haven't been able to qualify.
The simplest possible reproduction is the empty list with a thread pool of 1:
import scala.concurrent.ExecutionContext
import java.util.concurrent.Executors
import scala.collection.parallel.CollectionConverters._
import scala.collection.parallel.ExecutionContextTaskSupport
val col = List.empty[Int].par
col.tasksupport = new ExecutionContextTaskSupport(
ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(1))
)
// This will deadlock
col.map(_ + 1)
I have observed the same starvation issue with larger thread pools and lists, but not reliably enough to provide a reproduction case.
Metadata
Metadata
Assignees
Labels
No labels