 <p>You can ensure that the library in question is used only from a single thread at a time. If it contains instantiatable classes, one possibility is to hold these in <a href="http://en.wikipedia.org/wiki/Thread-local_storage#Java" rel="nofollow noreferrer">thread local storage</a>.</p> <p>Or you can build a thread-safe <a href="http://en.wikipedia.org/wiki/Adapter_pattern" rel="nofollow noreferrer">wrapper</a> around it.</p> <p>These approaches could also be combined, e.g. you can wrap the library in a class (it would be a <a href="http://en.wikipedia.org/wiki/Facade_pattern" rel="nofollow noreferrer">Facade</a> in this case), which is not thread safe in itself, but whose instances you access from a single thread at a time.</p> <p><strong>Update:</strong> as @Wim pointed out, if the library manages global state, you <strong>must</strong> have a thread safe wrapper to ensure that changes are made visible between threads.</p>