[M3devel] dynamic unload?
Jay
jay.krell at cornell.edu
Fri May 1 00:12:58 CEST 2009
Does any care what the following do?
int main()
{
while(1)
{
{
void* = dlopen("libm3core.so");
/* more stuff here */
dlclose(x);
}
return 0;
}
int main()
{
while(1)
{
void* x = dlopen("some-standalone-m3.so");
/* more stuff here */
dlclose(x);
}
return 0;
}
int main()
{
while(1)
{
void* x = dlopen("some-not-standalone-m3.so");
/* more stuff here */
dlclose(x);
}
return 0;
}
(On Windows, these are called LoadLibrary and FreeLibrary.)
I haven't run them but I expect they all behave poorly, leaking, leaking thread locals, crashing in the garbage collector thread, etc.
A lot of code out there in the world is ok to unload, and I guess a lot is not.
I think the above code shouldn't leak or crash.
I'm pretty certain they do, probably crash, or at least leak.
- Jay
More information about the M3devel
mailing list