Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple BackgroundWorkers c#
    text
    copied!<p>I have a server application which uses two BackgroundWorkers:</p> <p>1) Used to constantly check if the SVN repository was updated.</p> <p>2) Used for managing a queue of processes.</p> <pre><code>BackgroundWorker revisionsWorker = new BackgroundWorker(); revisionsWorker.DoWork += (queueSender1, queueEvent1) =&gt; checkRevision(); revisionsWorker.RunWorkerAsync(); BackgroundWorker queueWorker = new BackgroundWorker(); queueWorker.DoWork += (queueSender2, queueEvent2) =&gt; manageComputersQueue(); queueWorker.RunWorkerAsync(); </code></pre> <p>When the SVN is updated, the function <code>checkRevision()</code> updates the local repository, runs some scripts, and compiles a solution using <code>devenv.com</code>. The <code>queueWorker</code> checks if the server is busy running the <code>checkRevision()</code>. If it's not busy, it runs the processes according to their place in the queue.</p> <p>My problem is that if the SVN was updated, and the <code>checkRevision()</code> is running (takes some time..) the <code>manageComputersQueue()</code> is not accessed at any time, until <code>checkRevision()</code> is finished.</p> <p>Meaning, I want the <code>manageComputersQueue()</code> to run always, and if the server is busy doing other tasks, it will notify the client that the server is currently busy. </p> <p>Is it possible that when 1 backgroundworker is doing some stuff, other backgroundworkers are waiting for it to finish even if they all run asynchronously? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload