backgroundworker

Single Task processed by multiple backgroundworkers?

I have an array that is a list of files in a folder, I'm processing the files and renaming them. It takes about 15 minutes to rename them all, this is done daily. I currently have 1 Backgroundworker to handle this and update the UI. My question is, this: How can I use more than 1 Backgroundworker to use more than 25% of the CPU to do t...

Active object pattern instead of background worker class

The active object pattern was mentioned on Stack Overflow here. I have used the background worker class in C# in the past. The active object pattern looks interesting but more complicated. When should the active object pattern be used instead of the background worker class? ...

Fill dataGridView thank's to backGroundWorker

Hi I have this code sinnpet private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { remplirDataGrid(); } private void frmChercherActesLoad(object sender, EventArgs e) { backgroundWorker1.RunWorkerAsync(); } private void remplirDataGrid() { ...

Problem with BackGroundWorker

Hey all, I'm using a BackGroundWorker to avoid UI freezing while working with a method which uses wait handles, and this method is used to draw on a panel in the UI and has panel invalidation inside. something() { draw() panel.invalidate() A.waitone(500) } The problem is, sometimes the Worker gets stuck in the middle of the dra...

C# Multithreaded Proxy Checker

Hey, so got a new problem... I'm writing a multithreaded proxychecker in c#. I'm using BackgroundWorkers to solve the multithreading problem. But i have problems coordinating and assigning the proxys left in queue to the runnning workers. It works most of the time but sometimes no result comes back so some proxys get 'lost' during th...

AsyncTask: Is onPostExecute guaranteed to run after all calls to onProgressUpdate?

Hey all, I would like to know if it is possible to get 'leftover' calls to AsyncTask#onProgressUpdate after AsyncTask#onPostExecute has been called? I am setting text on the same TextView using both of them, and I don't want to set text such as "Done!" and then have it overwritten at a later point by text such as "Almost there - 90%" ...

Background Worker C# winform

is it a bad idea to load everything in from the background worker?? Current code is Executed on Form_load. we are pulling a lot of data from webservice. some long running works are in background worker. would it be a bad idea to load everything from background worker no matter how small or big the code is?? every function to run in bac...

BackgroundWorker troubles in Siverlight

I apologize in advance for the rambling nature of this question, but I have no idea where to start. I have an issue where I am trying to open an excel file in Silverlight, and do some processing on that excel file... but I have two major issues with doing this on the main thread. while opening the excel file the UI freezes with severa...

VB.Net Asynchronous background worker inside a loop.

Im using Vb.net visual studio 2008. i have got a process(system.diagnostics.process) to be run in background and it updates the Ui thread progressbar and a label and i have worked it using backgroundworker.runworkerAsync. Now the problem is i have to work the same process for a number of time with different inputs. The code block is : ...

C# BackgroundWorker Cancellation with Helper Function

Normally, when I want to cancel a backgroundWorker in C# I will do something like this: while (backgroundWorker1.IsBusy) { backgroundWorker1.CancelAsync(); autoResetEvent1.WaitOne(BGW_CANCEL_TIMEOUT); } In one application there are a number of backgroundWorkers. Is it valid to use a helper-function to c...

scoping NHibernate ISession in a spawned Thread with NInject

Ok, here's the scenario. I have an ASP.NET site that periodically spawns a background thread to do some jobs. the thread's execution consists of a JobRunner that iterates through a list of IJobs and calls Execute() on each one. JobRunner and each IJob is created by NInject. A couple of the IJobs have a dependency to IRepository<Model...

How can i get the instance of a BackgroundWorker from the currently executed method?

I am using a backgroundworker that can have n instances. Problem is the DoWork method (that has the 'sender' parameter which is the BackgroundWorker) calls other code that produces a callback - thus i dont have the sender. How can i determine the BackgroundWorker that the current code is running under? ex: private void SetupThread(...

How do I use MethodInvoker in C++ ?

I've got a C++/CLI application which has a background thread. Every so often I'd like it to post it's results to the main GUI. I've read elsewhere on SO that MethodInvoker could work for this, but I'm struggling to convert the syntax from C# to C++: void UpdateProcessorTemperatures(array<float>^ temperatures) { MethodInv...

C# BackgroundWorker ReportProgress Behaving Strangely

My backgroundWorker uses ReportProgress to update the ProgressPercentage of a long process. What happens is in two out of three entries into ProgressChanged ProgressPercentage is zero, whereas every third entry into ProgressChanged the ProgressPercentage is what I would expect. This happens like clockwork; it is very repeatable. Here ...

How to do background tasks in struts2?

Hi, i had a look on the struts plugins list here and wasn't able to find a plugin to do background/scheduled tasks. What i want to do, is run a daily task that pulls files from a few servers. I'd like this task to be run from within the web app, so that my importer gets access to all the data classes, also it would be less complicated I...

Is it a bad idea to create worker threads in a server process?

Hello, My server process is basically an API that responds to REST requests. Some of these requests are for starting long running tasks. Is it a bad idea to do something like this? get "/crawl_the_web" do Thread.new do Crawler.new # this will take many many days to complete end end get "/status" do "going well" # this can...

C# background worker

Hi, I have a task running in backgroundworker. on clicking the start button user starts the process and have got one cancel button to cancel the processing. When user clicks on cancel, I would like to show a message box that "Process has not been completed , do you want to continue". Here I want the processing which is left to be d...

When using quartz scheduler in a java web app (struts2), where do i configure the jobs?

Hi all, I'm trying to integrate quartz scheduler into a struts2 web app. Just wondering where you configure the jobs? I think the best place would be to put their details in the quartz.properties, but i cannot find the documentation that shows how to do this. All i can find is examples of how to programmatically create the jobs, but if...

How to solve the "Cross-thread operation not valid" Problem ?

I have a windows forms dialog, where a longer operation is running (asynchron) within a backgroundworker job. During this operation I want to change some values on the form (labels,...). But when the backgroundworker tries to change something on the form, I get the error "Cross-thread operation not valid"! How can this problem be solved ...

Using ProgressBar as a wait bar - how to avoid freezes?

I'm creating a custom charting control and I would like to have the possibility of displaying some sort of wait bar while other commands are running (i.e. chart is being created). I'm using ProgressBar (System.Windows.Forms.ProgressBar in marquee mode) as a part of this control. I do not need to update the state of the progress bar, I ...