• When Not to Use Thread Pool Threads

    There are several scenarios in which it is appropriate to create and manage your own threads instead of using thread pool threads:

    You require a foreground thread.

    You require a thread to have a particular priority.

    You have tasks that cause the thread to block for long periods of time. The thread pool has a maximum number of threads, so a large number of blocked thread pool threads might prevent tasks from starting.

    You need to place threads into a single-threaded apartment. All ThreadPool threads are in the multithreaded apartment.

    You need to have a stable identity associated with the thread, or to dedicate a thread to a task.

0 comments:

Leave a Reply

Thanks for sharing your feedback! If your feedback doesn't appear right away, please be patient as it may take a few minutes to publish - or longer if the blogger is moderating comments.