Do-Nothing WinForm App Using 4 Threads?



I've been researching multi-threaded WinForms apps and thread
synchronization stuff for a couple days since I'm working on
refactoring a multi-threaded GUI app at work and want to be sure it's
rock solid/thread-safe. I've seen all the posts about using BeginInvoke
to have worker threads interact with the UI. My question is this:

I created a plain old Windows Form application (VS.NET 2005) with a
blank form, built it (release build), ran it from Windows Explorer and
Task Manager claims the application is using four threads. What are
they? Obviously one is the main app/UI. What are the others?

I then added a Windows Timer control to the form and updated a label
every second. Still four threads. I expected a timer to be on its own
thread even though it posts "tick" events to the UI message
loop/thread.

I removed the Windows Timer and replaced it with a System Timer which
runs "tick" events on a different thread, yet the thread count still
stays at four. Huh?

Is there a built-in thread pool with a few workers hanging around to do
timers and stuff? What exactly is going on here?
Are those extra threads part of the CLR doing its magic to run the EXE?
Other?

My next question will be how many threads remoting (inter-process on
the same PC) adds to the mix. The UI app I'm refactoring makes use of
several remote objects (running methods and receiving events with
data). I'm guessing there is a thread for each proxy/socket to handle
marshalling stuff. And the event handling from remote objects
supposedly grabs a thread from the thread pool. Inquiring minds what to
really KNOW what's going on under the hood.

Pointers to good articles and/or books welcome. Spend the last weekend
Googling and reading...

Thanks!

.



Relevant Pages

  • Re: msflexgrid with ctrl-pgup & ctrl-pgdn
    ... It is still possible for your VB app to ... Timer event, which occurs about ten milliseconds after the key was ... Private Sub Form_Unload ... Private Declare Function SetWindowsHookEx Lib "user32" _ ...
    (comp.lang.basic.visual.misc)
  • RE: ldb file
    ... have a timer event set to check the value of the field in the back end to see ... If it indicates the app should be closed, then give the user a 5 ... Is there a way that I can I kick out the ...
    (microsoft.public.access.gettingstarted)
  • RE: ldb file
    ... have a timer event set to check the value of the field in the back end to see ... If it indicates the app should be closed, then give the user a 5 ... quit the application. ...
    (microsoft.public.access.gettingstarted)
  • Re: auto mouse click
    ... Say, for example, that you want to play this one: ... I made a little app with a timer and button, ... Then switch over to the web slot machine, ... Then click the button on your app, and it will start sending the Enter key ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Disk thrashing with paging file
    ... Your Timer suggestion is a very good idea which I'll try before ... to stop Windows paging out memory. ... user interface app and SQL Server. ... SetProcessWorkingSetSize or VirtualLock APIs make a difference? ...
    (microsoft.public.vb.winapi)

Loading