Re: Why does Thread class not support IDisposable?

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



You're still going to have problems.

If you've got all of the threadpool threads busy, you may end up deadlocking
the entire threadpool.

The think that keeps being danced around, is that a solution like this
performance waaaaay worse than a single-threaded soultuion. You're using all
system resources creating and scheduling threads. Almost no work is being
done towards your actual problem set.

Abuse of threads, be they custom threads, threadpool threads, IOCP threads,
or some new type I'm not aware of, all hurts performance and is an indicator
of a fundamentaly flawed desing.

.... breaking your work down into chunks, and passing those chungs to a set
of threads via a queue, is often the right design. You just can't point
1000+ threads at the queue and say "go!". At least not on a 1x, 2x, 4x, 8x
processor box.

--
Chris

"Martin Carpella" <martin.carpella@xxxxxxx> wrote in message
news:87wsrqur1c.fsf@xxxxxxxxxxxxxxxxxxxxx
"Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx> writes:

Instead, you just an ever-growing queue of new work items for the thread
pool.

Yes, I completely agree with you. In my opinion it is exactly this queue
which will "solve"/hide the error, as there are never "too many"
threads, as the ThreadPool won't grow beyond its maximum thread count.

It's true, using a thread pool can be a nice way to handle certain
aysynchronous operations. But if you've got a bug with regular threads,
you've still got a bug using thread pool threads.

Again, agreed. If the problem is that there are too many concurrent
requests, though, the TreadPool _could_ be the solution, as, as you
mentioned, the work items get queued instead of spawning a new thread.

Best regards,
Martin


.



Relevant Pages

  • Re: Bug in DBD::Oracle v 1.21 ?
    ... Unless this is not an exact copy, there appears to be a bug in your ... I am trying to write to an Oracle Stored procedure defined as: ... In perl ... ... For each execution, I get no errors and the queue is ...
    (perl.dbi.users)
  • Re: Memory leak in 1.9.2-p330?
    ... hopefully finding a bug in the code and not in Ruby:) ... The code pushes elements to a "time window" queue of 2 seconds. ... the max RSS size stays fixed when running with 1.8.7. ... All tests were done on Ruby compiled using rvm. ...
    (comp.lang.ruby)
  • Re: [PATCH 2/3] workqueue: not allow recursion run_workqueue
    ... works is not run orderly when recursion run_workqueue ... It's bug. ... So we should not allow workqueue trying to flush its own queue. ...
    (Linux-Kernel)
  • Re: [PATCH] workqueue: not allow recursion run_workqueue
    ... works is not run orderly when recursion run_workqueue ... It's bug. ... So we should not allow workqueue trying to flush its own queue. ...
    (Linux-Kernel)