(J) Ruby - Is killing a thread okay?

In Java, threads cannot be stopped. So, I am wondering if this is (Thread.exit) good in Ruby?

(FWIW, I use Ruby's JRuby flavor)

+3
source share
2 answers

In general, forcibly stopping or destroying threads is always contraindicated because you cannot guarantee the free release of resources and locks that the thread supports. So Nick is right, a variable indicating that the time to close the thread is generally better.

, , , . Thread # - , . , , . , JRuby Thread #. , , .

+2

Ruby, , , , , , , . , .

N

0
source

All Articles