2 ms·
If you only have one thread, you'll only use 1 core (maybe 2 with gc) A network application is a great use case. Usually you'll have one thread per connection.
by jfoutz 14y ago
If you only have one thread, you'll only use 1 core (maybe 2 with gc) A network application is a great use case. Usually you'll have one thread per connection.
In a more "normal" application you'll need to make threads. one very easy way to do that is pmap, map a function over data and spark a thread for each function invocation. But then you need to worry about the cost of creating threads vs the amount of work done, etc. there are always tradeoffs.