There is a principle in software development that “there are only three digits: 0, 1 and infinity”, which means that arbitrary restrictions are bad. Sometimes there are good reasons to have only one of the resources (for example, a log file). As soon as you have more than one, any arbitrary limit will eventually become a problem. Therefore, if you need more than one resource or object, you will need a pool that can contain an arbitrary number. You also need to choose how to allocate resources from the pool.
source
share