Re: thread pooling and short lived threads
From: David Levine (noSpamdlevineNNTP2_at_wi.rr.com)
Date: 10/14/04
- Next message: Shiva: "Re: How do you load a dropdownlist when edit is clicked in a datag"
- Previous message: Sriram Krishnan: "Re: Required Filed Validator Small Question"
- In reply to: AlexeiOst: "thread pooling and short lived threads"
- Next in thread: Jon Skeet [C# MVP]: "Re: thread pooling and short lived threads"
- Reply: Jon Skeet [C# MVP]: "Re: thread pooling and short lived threads"
- Reply: Willy Denoyette [MVP]: "Re: thread pooling and short lived threads"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 04:16:31 -0500
The threadpool is a system wide resource that by default provides 25
threads. The BCL uses this internally for many of its operations so if you
are making heavy use of it yourself in long-running tasks there is a danger
that you will exhaust all available threads.
However, it does sound like your processing requirements are good candidates
for a threadpool. There are plenty of opensource threadpool classes
available that you can use for those tasks; use google to locate one. This
will give you complete control over the number of threads in the threadpool
and how they behave, and you can customize it for your own purposes (e.g.
tasks of different priorities, etc).
"AlexeiOst" <AlexeiOst@discussions.microsoft.com> wrote in message
news:79398E16-5E8C-46D0-B7EB-D3ACB7CF06C6@microsoft.com...
> Everywhere in documentation there are recommendations to use threads from
> thread pooling for relatively short tasks. As I understand, fetching a
> page
> or multiple pages (sometimes up to 50 but not tipical) from the Internet
> and
> doing some processing on those would be considered to be a big/long task
> for
> a thread from a pool. In our app it is possible to break the task into
> some
> small ones (thread per fetch and processing thereafter or event smaller),
> but
> the more threads we create the more context switches we get. Where is the
> ballance point? What penalties do we incur for big/long tasks?
>
> One more thing. There seems to be a bug with large numbers of asynchronous
> IO where threads deadlock and timeout (it is all over the developers
> communities). Any info on when the fix is going to be out?
>
> Thank you,
>
> Alexei
- Next message: Shiva: "Re: How do you load a dropdownlist when edit is clicked in a datag"
- Previous message: Sriram Krishnan: "Re: Required Filed Validator Small Question"
- In reply to: AlexeiOst: "thread pooling and short lived threads"
- Next in thread: Jon Skeet [C# MVP]: "Re: thread pooling and short lived threads"
- Reply: Jon Skeet [C# MVP]: "Re: thread pooling and short lived threads"
- Reply: Willy Denoyette [MVP]: "Re: thread pooling and short lived threads"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|