Programmer: "Simple case mode is, every time it rains to buy an umbrella too wasted, rather than buy an umbrella put in the bag, to use it to take out, save money." ”
Sister paper: "It sounds so great, so why not make all the things like that?" ”
Programmer: "Because this also has its flaws, such as sister paper and boyfriend go out to work, rain, only one umbrella is not enough to use the slang called shared resource contention, or thread conflicts. ”
Programmer: "Because the umbrella this kind of thing is not two people to share (slang called thread unsafe object), so the family only one umbrella is not enough." But if it is like air conditioning so that everyone can use together (slang called thread-safe object), you can buy only one, the whole family together (the Tao's slang called the "enjoy meta-mode"). ”
Sister paper: "Then let the boyfriend himself to buy an umbrella?"
Programmer: "This certainly can also (slang called private object), but if the boyfriend lost, Umbrella also lost, and men too troublesome, do not like to carry an umbrella every day, the diagram convenient to use when you buy an umbrella, or is very wasteful. ”
Sister paper: "This simple, then buy a few umbrellas to put home, who need to take to use well." ”
Programmer: "Sister paper you are so awesome." This is the object pool pattern of the bull's fork. Only high-level programmers will tinker with what pool out (thread pool, connection pool), sister paper savvy so high, or join programming this very promising career it. ”
To the girl who does not know the technology, clear single-row mode