I came across the scala.concurrent.blocking method, and according to the Scala documentation this is ...
Used to indicate a piece of code that potentially blocks, allowing the current BlockContext to configure runtime behavior. Properly labeled lock code can improve performance or avoid deadlocks.
I have some doubts:
- What is the factor by which new threads will appear?
- Is this applicable only to the
scala.concurrent.ExecutionContext.Implicits.global runtime scala.concurrent.ExecutionContext.Implicits.global or to custom runtime contexts? - What happens if I complete any executable with
blocking { ... } ? - Any practical case when we should use this design.
Sourav Chandra Oct 30 '13 at 11:47 2013-10-30 11:47
source share