Joerg Budischewski wrote:
[...]
The java uno bridge need to create also a fresh thread for each release (or at least for each concurrent release). It can't be a single thread doing the releases, because this would end in the same problem.

A single additonal thread is enough to avoid the deadlock (thread A needs more memory, and thus the finalizer thread, but the finalizer thread waits for a mutex locked by thread A).

On top of that, since the amount of memory available to a JVM is finite, it is important to keep the number of reachable objects within a JVM small at every point in time. Whether adding a single thread or multiple threads in the given case helps achieve this goal better is not a matter of correctness, but a matter of fine tuning.

IMO, the simplest approach should be tried first. Only if it is known to behave badly (i.e., lead to OutOfMemoryError) often enough a more complex approach should be tried.

The simplest approach (call release synchronously from the finalizer thread) is known to deadlock. It is arguable whether that deadlock is due to an error in the bridge, or due to an error in the involved UNO object implementations. However, if we agree on the former, the next approach in terms of simplicity would be to have exactly one extra thread.

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to