摘要 |
A threadsafe object pool in accordance with the preferred embodiments reserves each object for a particular thread of execution. Locking of an object pool is normally required to assure that two threads cannot simultaneously request the same object. However, because each object in the pool is reserved for a single thread, no other threads will be allowed to access the object, so the locking of the pool to prevent simultaneously allocating an object to two different threads is not required.
|