title: SharePoint TimerJobs and threading
body: <p>I've written a SharePoint 2010 app that uses a TimerJob to trigger processing of some documents in a list. The timer is set to trigger every minute but the the processing may take more than a minute. I'm just wondering if the next trigger of the timer job will be started using a new thread, or will the timer service just wait until the first thread has completed. I have no idea how Sharepoint manages threads for TimerJobs and I can't really find any relevant information.</p>
  
  <p>This is possibly a problem given that my <code>TimerJob</code> definition has the following:</p>
  
  <pre><code> public override void Execute(Guid contentDbId)
      {
          try
          {
              SPWebApplication webApplication = this.Parent as SPWebApplication;
              SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];
              using (SPSite site = contentDb.Sites[0])
              {
                  using (SPWeb web = site.RootWeb)
                  {                       
                      PRManager.TriggerProcessing(web);    // ?                   
                  }
              }
          }                      
          catch (Exception)
          { 
          }
      }
  }
  </code></pre>
  
  <p>The <code>PRManager.TriggerProcessing()</code> is a static method, obviously, and while it does contain mechanisms to limit only one thread at a time entering the method body, I'm just wondering IF SharePoint does create multiple threads in the event that those at-minute-interval calls to execute overlap.</p>