When to use Runnable? When to use Callable?

When it comes to Java, we have to talk about multi-threading. Even if you don’t want to say it, the interviewer has to let you say it, right? When it comes to multi-threading, threads are not allowed to be mentioned (isn’t this nonsense). When it comes to threads, we have to talk about Runnable and […]

When to use Runnable and Callable

When it comes to Java, we have to talk about multi-threading. Even if you don’t want to say it, the interviewer has to let you say it, right? When it comes to multi-threading, threads are not allowed to be mentioned (isn’t this nonsense). When it comes to threads, we have to talk about Runnable and […]

Multi-threading in one pot (Runnable, Callable, Thread, Future, FutureTask)

Multi-threading in one pot (Thread, Runnable, Callable, Future, FutureTask) In the multi-thread execution cycle, the basic process can be briefly divided into (new execution task->create task process->task assembly process->start/execute thread->get result/status). The processes responsible for various elements are as follows Show: Element name/process New execution task Create task process Task assembly process Start/execute thread Get […]

[Java] When to use Runnable? When to use Callable ?

Article directory foreword Runnable Callable how to choose which one to use at last Foreword When it comes to Java, you have to talk about multithreading. Even if you don’t want to talk about it, the interviewer has to ask you to talk about it, right? When it comes to multithreading, you don’t have to […]

springboot integrates activiti with modeler for process creation, editing, deployment and deletion of instances (runnable)

<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-spring-boot-starter-basic</artifactId> <version>5.22.0</version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-diagram-rest</artifactId> <!– exclusions: activiti-diagram-rest contains a security jar package, which leads to the need to log in to access springbott, so the login is removed here –> […]

Qt thread pool QThreadPool class, QRunnable class

QThreadPool class Used to manage QThreads. All functions in this class are thread-safe. Main attributes: 1. activeThreadCount: This attribute indicates the number of active threads in the thread pool, which is called by activeThreadCount(). 2. expiryTimeout: The time the thread is alive. Threads with no expiryTimeout milliseconds set will automatically exit, and such threads will […]