Creating control in a threadpool thread slows down Excel startup ( bug in framework?).
- From: kjartan.storli@xxxxxxxxx
- Date: 30 Sep 2005 06:58:09 -0700
Hi,
Below is a small application which recreates a problem we found in one
of our
programs.
When this application is run it takes almost a minute to start Excel if
you double-click on an Excel file. It seems like it has the same effect
on other programs which is started with DDE commands.
class ThreadPoolTest
{
static void Main(string[] args)
{
System.Threading.TimerCallback ts = new
System.Threading.TimerCallback(CallbackTarget);
System.Threading.Timer t = new System.Threading.Timer(ts , null , 0 ,
3000);
System.Windows.Forms.Application.Run();
}
private static void CallbackTarget(object o)
{
System.Windows.Forms.Control c = new System.Windows.Forms.Control();
c.CreateControl();
}
}
Notice that during program execution the CallbackTarget function is
called in a threadpool thread.
If you try to start Excel by double clicking on an Excel file while the
app is running, it takes a long time before Excel is loaded ( sometimes
over a minute).
I understand that creating a control on a threadpool thread might be a
bit strange, but I haven't understood *why* this affects other
programs.
Can someone explain this behavour, or is it a bug in the .Net framework?
.
- Follow-Ups:
- Prev by Date: Re: Noob Question about loop counters (are they re-calculated?)
- Next by Date: Re: Removing of Windows service
- Previous by thread: Font size of the main menu
- Next by thread: Re: Creating control in a threadpool thread slows down Excel startup ( bug in framework?).
- Index(es):
Relevant Pages
|