Learning immediately: https://edu.csdn.net/course/play/26755/340176?utm_source=blogtoedu
Semaphore is a counter for recording consumption of resources. When the resource consumption decreasing increments when resources are released. Can be considered a signal representative of the amount of resources are available.
from threading import BoundSenaphore