Two stage termination mode


Two stage termination mode

Two-Phase Termination Patter

Description: enables the monitoring thread to gracefully terminate other running worker threads

Code implementation:

class TwoPhaseTermination {

Test code:

public class TwoPhaseTerminationTest {

    public static void main(String[] args) {

        TwoPhaseTermination pattern = new TwoPhaseTermination();

        try {
        } catch (InterruptedException e) {

Operation results:

Two stage termination mode

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress: recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]