[Mono-devel-list] AW: AW: AW: appdomains_list
Dietmar Maurer
dietmar at ximian.com
Thu Jul 10 05:02:01 EDT 2003
> -----Urspr¨¹ngliche Nachricht-----
> Von: He HongFu [mailto:hfhe at stryon.com]
> Gesendet: Donnerstag, 10. Juli 2003 03:00
> An: Dietmar Maurer
> Betreff: Re: AW: AW: appdomains_list
>
>
> Dietmar Maurer:
>
> I think mono_runtime_cleanup() can only cleanup the
> object AddDomain in Managed code, it cannot release the
> resource from mono_domain_create(), which just hardcode to
> release from mono_domain_unload().
I looks like we can simply use the force parameter passed to
mono_domain_unload:
If (force) ...
> So, we need a function mono_cleanup(), which be called at
> mini_cleanup(), instead of called mono_domain_unload().
> mono_cleanup() find all domain in appdomains_list, then
We already have mini_cleanup(). Whats the problem using that?
> call mono_domain_unload() one by one. It is a pity that
> appdomains_list is a HastTable, it is hard to find it node if
> no key provided. What about GList?
Where do you need to find an entry without a key? Even if you need that you
can do a linear search through the hash table, which is as fast as using a
Glist.
And we also need to hold a reference to the appdomain object to prevent
garbage collection - thats why we use MonoGHashTable instead of a
GHashTable/GList.
- Dietmar
>
> ======= 2003-07-10 10:28:00 =========================
>
> >But we can add it to mono_runtime_cleanup() ?
> >
> >- Dietmar
> >
> >> -----Urspr¨¹ngliche Nachricht-----
> >> Von: He HongFu [mailto:hfhe at stryon.com]
> >> Gesendet: Donnerstag, 10. Juli 2003 17:49
> >> An: Dietmar Maurer
> >> Betreff: Re: AW: appdomains_list
> >>
> >>
> >> Dietmar Maurer:
> >>
> >> Yes, we can add code :
> >> if (mono_g_hash_table_size(appdomains_list) == 0) {
> >> mono_g_hash_table_destroy (appdomains_list);
> >> appdomains_list = NULL;
> >> }
> >> at mono_domain.unload() function.
> >>
> >> but if user write some code following:
> >>
> >> AppDomain newDomain =
> >> AppDomain.CreateDomain("newDomain", evidence, setup);
> >>
> >> and don't to call AppDomain.Unload(newDomain). Mono
> >> cannot cleanup this domain when JIT ends.
> >>
> >>
> >> ======= 2003-07-10 08:38:00 =========================
> >>
> >> >> -----Ursprüngliche Nachricht-----
> >> >> Von: He HongFu [mailto:hfhe at stryon.com]
> >> >> Gesendet: Mittwoch, 09. Juli 2003 03:01
> >> >> An: dietmar at ximian.com
> >> >> Betreff:
> >> >>
> >> >>
> >> >> Hi, Dietmar Maurer:
> >> >> in function mono_init() located at file domain.c,
> allocated a
> >> >> new hashtable for global variable "appdomains_list', I
> think it is
> >> >> felicitous to release the global varialbe at function
> >> >> mono_domain_unload(), which destroy a domain allocated by
> >> >> mono_init(), OK?
> >> >
> >> >No, mono_domain_unload() only unloads a single domian, but we use
> >> >appdomains_list during the lifetime of an application (not
> >> the lifetime
> >> >of a domain).
> >> >
> >> >Maybe it would be possible to check how many domains are
> >> alive. If we
> >> >unload the last appdomain we can also release appdomains_list.
> >> >
> >> >- Dietmar
> >>
> >> = = = = = = = = = = = = = = = = = = = =
> >>
> >>
> >>
> >> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡He HongFu
> >> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡hfhe at stryon.com
> >> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-07-10
> >>
> >>
> >>
>
> = = = = = = = = = = = = = = = = = = = =
>
>
>
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡He HongFu
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡hfhe at stryon.com
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-07-10
>
>
>
>
More information about the Mono-devel-list
mailing list