Re: thread pooling and short lived threads

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Levine (noSpamdlevineNNTP2_at_wi.rr.com)
Date: 10/14/04


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



Relevant Pages

  • Re: [kde-linux] KAddressBook & Google Contacts
    ... trying to add my Google Contacts as resource using Akonadi to ... KAddressBook. ... Google Calendars as well as IMAP work great in KOrganizer ...
    (KDE)
  • I also wonder...
    ... straight forward questions without taking time to research ... Google is a great resource for finding answers. ... How do I play my mp3 files? ...
    (Fedora)
  • t o the c -- in context, for those who can read.
    ... Perhaps it will help to put "Google first" into ... Clarifying comment: ... population using a public resource grows too large, ... many "free riders" will destroy any common resource. ...
    (alt.coffee)
  • Re: dvd playback application
    ... and posters are encouraged to search Google first. ... The result of a Google answer and a human answer will likely be similar: ... a link to an existing resource. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: Boy this place is certainly getting flooded ...
    ... Google's archive is an excellent resource. ... Awhile back, my ISP cancelled usenet. ... I used google for over a year before getting a new ISP for regular ... I only opened Agent because I had a question and no replies. ...
    (rec.photo.digital)