April 2008
Intermediate to advanced
704 pages
17h 49m
English
Problem
You need to execute a task using a thread from the runtime's thread pool.
Solution
Declare a method containing the code you want to execute. The method's signature must match that defined by the System.Threading.WaitCallback delegate; that is, it must be a subroutine (not a function) and take a single Object argument. Call the Shared method QueueUserWorkItem of the System.Threading.ThreadPool class, passing it your method name. The runtime will queue your method and execute it when a thread-pool thread becomes available.
How It Works
Applications that use many short-lived threads or maintain large numbers of concurrent threads can suffer performance degradation because of the overhead associated ...
Read now
Unlock full access