I am not sure what you want to do is possible.
At a minimum, you would have to do your hand off before the start level
thread acquires the locks. If the start level thread is only acquiring
lock objects, you could potentially modify them to make them
transferable to another thread, but this would be tricky and if the
thread is holding any synchronized block locks, then this approach
wouldn't work.
This will be difficult. Make sure you are looking at the trunk code,
since the locking code has changed a lot since the last release.
-> richard
On 3/14/09 4:01 PM, João Ferreira wrote:
Hi
I'm doing some work in OSGi in an attempt to add better resource
monitoring to osgi applications. My objective is to isolate the cpu
consumption across the different bundles. To implement this my
strategy is to group the different threads in ThreadGroups, where
there is a different ThreadGroup for each bundle.
In the "Felix.startBundle(BundleImpl bundle, boolean record)" method i
create a new thread and a new thread group to call the
"SecureAction.startActivator(BundleActivator activator, BundleContext
context)" method. i start this new thread and wait for it to die. The
problem is i get a deadlock because the startlevel thread is waiting
and holding the lock, and the new thread is trying acquire the lock to
register services (in this case the shell bundle is registering the
shell service). In the actual Felix implementation the register
service method can acquire the lock because its the same thread.
I would like some help so i dont break the framework. What would be
the best solution to my problem? Release the lock before starting the
new thread and this new thread acquire the lock? Modify the
bundle.isLockable() method to allow other threads to lock?
Thanks in advance
João Ferreira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org