在我的应用程序中,我有4个不同的进程,它们永久运行,中间有一些小的停顿。当前版本的代码在单独的老式线程中执行每个进程:ThreadnlpAnalyzer=newThread(()->{//infinelopforautorestoreincaseofcrash//noinspectionInfiniteLoopStatementwhile(true){try{//thismethodshouldrunpermanently,pausesimplementedinternallyNLPAnalyzer.analyzeNLP(dbCollection);}catch(Exceptione)