There is one thread pool per process. The thread pool has a default size of 250 worker threads per available processor, and 1000 I/O completion threads.
I might ask the candidate to describe at least 2 or 3 different ways to create multi-threaded applications in C#.
I might ask the candidate to describe at least 2 or 3 different ways to create multi-threaded applications in C#.
- Explicit use of Thread class
- Threadpool
- Task Parallel Library
- Action class with lambda functions
- BeginInvoke
- BackgroundWorker
I would also inquire how one might end up with an application that is multi-threaded without ever explicitly creating a thread.
- Event handlers can run in another thread (SerialPort.DataReceived comes to mind, as does one or two of the three Timers in .Net).
You may also wish to talk about methods for creating re-entrant code.
- lock
- Monitor.Wait and Monitor.Pulse
- ManualResetEvent
- static classes/methods
Some more information could come from a post I wrote here.
No comments:
Post a Comment