It is easy to change the number of orders from 10 to 20 and then re-run this anonymous block without recompiling.
您可以轻松地将订单数改为从10到20,然后重新运行这个匿名块而不需要再进行编译。
3
If it is not small enough, you should analyze your code and refactor it in such a way that anything that could run asynchronously is located outside of the synchronized block.