foreach - Scala Parallel Print Hanging the console -


i new scala world , trying exercises book. so, have example print vector in sequential , parallel fashion. former works , later hangs console.

code

val v = vector.range(0, 10) v.foreach(println) 

code output

0123456789 

but if use same code, instead of using foearch, use par, freezes console

val v = vector.range(0,10) v.par.foreach(println) 

the book using says output should like:

5678901234     

but hangs , program never finishes.

can explain me why?


Comments

Popular posts from this blog

c++ - CPP, 'X' button listener -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -