Eclipse-BuddyPolicy: global question [message #498962] |
Thu, 19 November 2009 05:46  |
Eclipse User |
|
|
|
Hello everyone,
I have a question related to the Eclipse buddy classloading mechanism. In particularly, I am interested in the global buddy policy. I have read at [1] that:
"global - Consults the available packages exported in the global pool of exported packages."
My question is: what does "global pool of exported packages" mean? Sorry this might seem like a newbie question, but all my searches through the documentation and through the Eclipse forums didn't help me to find the significance of this phrase.
Thanks,
Florin.
[1] http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhan cements
|
|
|
|
|
|
Re: Eclipse-BuddyPolicy: global question [message #500500 is a reply to message #499620] |
Thu, 26 November 2009 07:38  |
Eclipse User |
|
|
|
23.11.2009 16:52, Paul Webster kirjutas:
> The advantage ... I think it's a hack to support 3rd party libraries
> that don't know about OSGi and use things like Class.forName(*). At
> least IMHO.
>
> If you're OSGi aware you wouldn't do that.
>
I would also warn against using BuddyPolicy if at all possible and
sticking to the most restrictive buddy policy possible, if not.
The experience has shown that using liberal BuddyPolicy can lead to
classloading deadlocks - and quite often these deadlocks manifest
themselves months later because of a seemingly small change will change
timing of class loading operations.
The issue with BuddyPolicy is that it inadvertently breaks the bundle
class loading hierarchy and can cause subtle but fatal dependency cycles
between bundles, which can lead to bundle class loaders acuiring locks
in an unpredictable order and getting into deadlock with another class
loading operation.
There is also a preformance issue that when a class needs to be loaded,
the more liberal the BuddyPolicy, the wider is the class name search
path on each class load.
One of the side-effects of a buddy policy is also that it may braks
Eclipse lazy-loading paradigm, by activating all bundles that get
visited due to the class loading request.
Don't mistake me - sometimes using BuddyPolicy is unavoidable, but You
must be aware that there be dragons under that road and tread with due
caution...
--
Roland Tepp
|
|
|
Powered by
FUDForum. Page generated in 0.04009 seconds