Erlang Processes vs Java Threads

后端 未结 6 1440
别那么骄傲
别那么骄傲 2020-11-29 21:18

I am reading \"Elixir in Action\" book by Saša Jurić, and in the first chapter it says:

Erlang processes are completely isolated from each other. They

6条回答
  •  孤独总比滥情好
    2020-11-29 21:42

    when Java thread dies, it too does not impact other threads

    Let me ask a counterquestion: why do you think Thread.stop() has been deprecated for more than a decade? The reason why is precisely the negation of your statement above.

    To give two specific examples: you stop() a thread while it's executing something as innocuous-sounding as System.out.println() or Math.random(). Result: those two features are now broken for the entire JVM. The same pertains to any other synchronized code your application may execute.

    if we are looking at request-processing threads

    The application may theoretically be coded such that absolutely no shared resource protected by locks is ever used; however that will only help to point out the exact extent to which Java threads are codependent. And the "independence" achieved will only pertain to the request-processing threads, not to all threads in such an application.

提交回复
热议问题