dll loading time performance
Hi all,
I got a problem, I want to speed up the startup of my huge application
(100 dlls)
the loading of one particular dll (gred.dll) takes about 10sec. one my
of my colleague suggested to load that dll in a background thread at
startup.
Here's my action i have created a class CTaskThreads
// in the constructor
this->m_Thread = AfxBeginThread(WorkerThreadLauncher, this);
UINT CTaskThreads::WorkerThreadLauncher(LPVOID pvParam)
{
CTaskThreads *pThreadInstance =
reinterpret_cast<CTaskThreads *>(pvParam);
return pThreadInstance->Execute();
}
UINT CTaskThreads::Execute()
{
DWORD start = ::GetTickCount();
do
{
::Sleep( 1000 );
HINSTANCE hInstLib = ::LoadLibrary(_T("GRED.DLL"));
if ( hInstLib == NULL)
{
ASSERT(FALSE);
}
} while ( this->m_StopThread == false ) ;
DWORD end = ::GetTickCount();
this->ExecutionTime = end - start;
return 0;
}
Then in my executable module, initinstance() i have declare a
CTaskThreads object.
unfortunately in some dll it failed to load some xml file ressources.
Since I am a beginner in this area i have a few questions regarding
this issue :
Why loading a dll takes time ? it depends on what ?
Is it a good idea to load a library the way i did ?
Is there a better solution ?
why it is imposible to load some ressources in some linked dll ?
thk u
Franck-o