2 ms·
...any very short lived concurrent task. A thread costs, what, 10 or 20us to create on a typical linux/x86 system? Perhaps it's more on the JVM? Look, I'm loo
by AlisdairO 5y ago
...any very short lived concurrent task. A thread costs, what, 10 or 20us to create on a typical linux/x86 system? Perhaps it's more on the JVM?
Look, I'm looking forward to Loom as much as anyone. It is clearly going to be a big leap forward to the java ecosystem, and I'm looking forward to some threaded model being appropriate for any job rather than just most of them. It's just I see this terror of creating a thread or two out in the wider world and it seems a touch overwrought to me.
- pron 5y ago10 or 20us can be longer than some IO operations. But the direct issue with OS threads is simply that you can't realistically have too many of them, and so they limit your level of concurrency. If the number of threads you can maintain is more than the average request rate times the average latency of each transaction (if it were processed on a single thread), then you're all good; if it's less, then your server will crash as requests pile up. Fear doesn't play a role here, just Little's law.