4 ms·
no it's not. How do you coordinate between those processes? It's far easier to use a producer/consumer model on the jvm with threads. I do this all the time and
by jshen 15y ago
no it's not. How do you coordinate between those processes? It's far easier to use a producer/consumer model on the jvm with threads. I do this all the time and it's really easy, much easier than managing multiple processes and some kind of external queue like redis.
- cageface 15y agoIf you're writing a distributed app you have to write the process coordination logic and the fact that two processes happen to be on the same machine is incidental. This is how all the big webapps scale.
- jshen 15y agoBut you make a giant mistake assuming that everyone is writing big web apps.
- cageface 15y agoAssuming no such thing. It's just the easiest example to hand. At Pixar we used similar techniques for rendering.
- jshen 15y agoyou said, "the easy way to leverage those cores is to spin up a server process for each core" It's not THE easy way. It's actually the harder way, but in some cases, like giant public web apps, you have to do the hardway anyway. Managing a work queue using java.util.concurrent in process is far easier than managing many processes and coordinating across something like redis.