OK, as I understand it, the .NET Threadpool maintains a number of background threads ready to be used for tasks of some kind.
The Get/SetMinThreads and Get/SetMaxThreads methods contain two parameters that can be returned or adjusted.
According to MSDN the two parameters indicate the number of worker threads and the number of threads ...
This is more a generic question than a specific one. I'm trying to have a multi threaded environment that stays active so that I can just submit tasks and run them. I want to do this without the hassle of executing in a web server or application server. The idea was to use a java thread pool for this, but the issue here is that the pool ...
Hello,
Sometimes my application consumes 100 cpu. When I investigate crush dumps in windbg I always see huge "request queue" in the log and I am very suspicious of this huge amount of requests. Definitely I want to know where they come from, but at the first place I don't quite understand what it means. Does it mean that there are lots ...
Let me preface this with the disclaimer that I am very new to multithreading and may be missing something obvious.
I'm currently using the below code to process all the files in a directory. My question is if it would ever be possible for a thread to finish, decrement numFilesLeft, and find it equal to 0 because the next item hasn't bee...
I have an IIS 6.0-based C#/ASP.NET web site with a SQL server backend. I want to generate some computationally expensive reports (summaries, search engine indexes, etc...) in idle CPU time. I need the reports to be generated from WITHIN the IIS App Pool so it knows the proper configuration settings and (harder to fix) avoids the nightm...
There are a huge amount of tasks.
Each task is belong to a single group. The requirement is each group of tasks should executed serially just like executed in a single thread and the throughput should be maximized in a multi-core (or multi-cpu) environment. Note: there are also a huge amount of groups that is proportional to the number o...
I have an application that processes file transfers. In some instances, I need to launch some pre/post processing executables that do stuff with the files.
So the order of events (in brief) would be like this:
Worker thread is created
Worker realizes it needs to launch a pre-process executable before starting the transfer
Pre-process...
I think I may need to re-think my design. I'm having a hard time narrowing down a bug that is causing my computer to completely hang, sometimes throwing an HRESULT 0x8007000E from VS 2010.
I have a console application (that I will later convert to a service) that handles transferring files based on a database queue.
I am throttling th...
What is the simplest way to to wait for all tasks of ExecutorService to finish? My task is primarily computational, so I just want to run a large number of jobs - one on each core. Right now my setup looks like this:
ExecutorService es = Executors.newFixedThreadPool(2);
for (DataTable singleTable : uniquePhrases)
{
es.execute(n...
Hi there,
I'm bugfixing someone else's code where it takes ages to return the complete dataset in the following code:
DataTable dt = someLib.GetDataTable("EXEC [dbo].[CMS_Content_GetAllContents]");
// Copy the DataTable data to list.
foreach (DataRow dr in dt.Rows)
{
ContentInfo aContentDetail = new ContentInfo(
(in...
I have a Silverlight 3 application which needs to call WCF service. The WCF service in turn calls an ASMX web service. When the WCF service call completes, the silverlight UI needs to be updated.
WCF is being called in async.
The thing is that the Silverlight app needs to call the WCF method(which later calls asmx internally) hundreds ...
I have read about executing asynchronous operations and i found that it can be done at the SQL command executions side(that is handled during executing SQL command by adding wait handle that waits for AsynchResult) or from the UI execution side(which is done by using delegate that points to a method then begin invoke methods asynchronous...
Hello,
I have a List with items that I want to download. I use a for Loop to iterate the list.
For each item in this List I start a new Thread that references the item. My Problem is that I want limit the maxDownload at the same time.
for (int i = downloadList.Count - 1; i >= 0; i--)
{
downloadItem item = downloadList[i];
if (...
I'm trying to find the best solution for periodic task running in parallel. Requirements:
Java (Spring w/o Hibernate).
Tasks are being managed by front-end application and stored in MySQL DB (fields: id, frequency (in seconds), <other attributes/settings about task scenario>). -- Something like crontab, only with frequency (seconds) fi...
Is it possible to purge a ThreadPool?
Remove items from the ThreadPool?
Anything like that?
ThreadPool.QueueUserWorkItem(GetDataThread);
RegisteredWaitHandle Handle = ThreadPool.RegisterWaitForSingleObject(CompletedEvent, WaitProc, null, 10000, true);
Any thoughts?
...
I have a win service hosting a few workflows (a WorkflowApplication and a WorkflowServiceHost) that I need to keep long running. Because OnStart() requires that it completes and returns to the OS, I have a main method that fires on another thread in a threadpool. My Onstart() mainly looks like this
protected override void OnStart(string...
I may imagine some tasks scheduled to take a very long time and ScheduledThreadPoolExecutor would create additional threads for the other tasks that need to be run, until a maximum number of threads is reached.
But seems that I can only specify a fixed number of threads for the pool, why is that so ?
...
I'm new to multithreading in Perl and looking for something similar to Java's thread pools.
Any recommendations?
...
Taken from Microsoft documentation:
By default, the thread pool has 250 worker threads per available processor. You can
change this setting using the ThreadPool.SetMaxThreads method.
It's also said, as it's widely known, that there is some overhead:
Threads have some level of overhead. Therefore, if a computer has multiple pr...
I need to use a thread pool in python, and I want to be able to know when at least 1 thead out or "maximum threads allowed" has finished, so I can start it again if I still need to do something.
I has been using something like this:
def doSomethingWith(dataforthread):
dostuff()
i = i-1 #thread has finished
i = 0
poolSize = 5
t...