Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated synchronize faq question

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="00a97adce4d2f780-aca683c4-430a4076-b7339658-335de97e30c145f2a23bcccc"><ac:plain-text-body><![CDATA[

http://jakarta.apache.org/commons/pool/images/pool-logo-white.png

[http://jakarta.apache.org/commons/pool/ Commons-Pool] provides a generic object pooling interface, a toolkit for creating modular object pools and several general purpose pool implementations.[BR] A lot of information is available on the [http://jakarta.apache.org/commons/pool/ Pool website]. If you don't find the information you need you can always contact us using one of the [http://jakarta.apache.org/site/mail2.html#Commons mailing lists].

]]></ac:plain-text-body></ac:structured-macro>

...

Q: If I have multiple threads calling into my method which contains the borrowObject call, do I have to synchronize around this, or are borrowObject and returnObject thread safe?

A: They appear to be thread safe. I haven't extensively studied the source the relevant code is synchronizedIt's implementation dependent. The implementations that come in the official download are thread safe. Of course it is possible this may change in the future if new implementations are added to the package. Be sure to check the JavaDocs.

Q: What is the general purpose of pooling Interfaces ?

...