How to remove deadlock in Java code using NetBeans

I have old code in Java that blocks ... I have never used netbeans as a development tool ... however I need to fix the code.

I started the application in debug mode, clicked the "Check deadlock" button, and netBeans took the screen. Two of the four streams were in red ... see at the bottom of the screen.

I'm new to multithreading, and the top of this code is not mine ...

What is most likely causing the problem?

alt text

+3
source share
1 answer

, , , (, , , ) . ( ):

  • nano.toolbox.strategies.ESMarketMaker
  • nano.toolbox.strategies.ExecutionManager

, , , "ExecutionManager" ExecutionManager, ( "ExecutionManager" ) "ESMarketMaker" .

, "StrategyManager" "ESMarketMaker" , ( "ESMarketMaker" ) "ExecutionManager" .

, .

:

  • , , - , ( - ). , , , .
  • tryLock(), , , , - . , , , , ( , , , , , , ).

, , , , Java. ReentrantLock , , , , try-locks, .

, , , , .: -)

(, ps, , , - , , - , , , , ).

+5

Source: https://habr.com/ru/post/1770415/


All Articles