Semaphore sleep problem

Source: Internet
Author: User

Today's test found a bug that would have errors when executing two commands with the module I was responsible for, such as "Command 1;command 2".

Analysis code found two questions,

First, command 1 in the creation of a background process, when the background process is created, the process continues to execute, ignoring the background for execution, so there may be a background for execution to complete, and command 2 to start execution of the situation, the order of execution is chaotic.

Second, command 1 sent a sigterm signal, and the module handler function has a sleep type function, when there is such a function, the process will sleep and give up the CPU, this time will continue to execute command 2, the order of the execution of the sequence of confusion.

Semaphore sleep problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.