title: Two parallel ajax requests to Action methods are queued, why?
body: <p>I'm developing a video website using ASP.NET MVC.</p>
  <p>One functionality I want to have in my application is transocding video. But as the transcoding process could be very time-consuming, I want to show the progress of that process to the client user.</p>
  <p>So, my schema is to use one controller action to handle the whole transcoding process and write its progress into a file stored on the server. Meanwhile I use Ajax to call another controller action to read the specified file, retrieve the progress information and send it back to the client for display every 2 seconds during the transcoding process.</p>
  <p>To fulfill my plan, I have written the following code:</p>
  <p>Server Side:</p>
  <pre><code>public class VideoController : Controller
  {
           //Other action methods
           ....
      //Action method for transcoding a video given by its id
      [HttpPost]
      public async Task&lt;ActionResult&gt; Transcode(int vid=0)
      {
          VideoModel VideoModel = new VideoModel();
          Video video = VideoModel.GetVideo(vid);
          string src = Server.MapPath(&quot;~/videos/&quot;)+video.Path;
          string trg = Server.MapPath(&quot;~/videos/&quot;) + +video.Id+&quot;.mp4&quot;;
          //The file that stores the progress information
          string logPath = Server.MapPath(&quot;~/videos/&quot;) + &quot;transcode.txt&quot;;
          string pathHeader=Server.MapPath(&quot;../&quot;);
  
          if (await VideoModel.ConvertVideo(src.Trim(), trg.Trim(), logPath))
          {
              return Json(new { result = &quot;&quot; }); 
          }
          else
          {
            return Json(new { result = &quot;Transcoding failed, please try again.&quot; });
          }
      }
  
      //Action method for retrieving the progress value from the specified log file
      public ActionResult GetProgress()
      {
          string logPath = Server.MapPath(&quot;~/videos/&quot;) + &quot;transcode.txt&quot;;
          //Retrive the progress from the specified log file.
          ...
          return Json(new { progress = progress });
      }
  }
  </code></pre>
  <p>Client Side:</p>
  <pre><code>var progressTimer = null;
  var TranscodeProgress = null;
  
  // The function that requests server for handling the transcoding process
  function Transcode(vid) {
      // Calls the Transcode action in VideoController
      var htmlobj = $.ajax({
          url: &quot;/Video/Transcode&quot;,
          type: &quot;POST&quot;,
          //dataType: 'JSON',
          data: { 'vid': vid },
          success: function(data)
          {
          if(data.result!=&quot;&quot;)
              alert(data.result);
          }
          else
          {
            //finalization works
            ....
          }
      }
      });
      //Wait for 1 seconds to start retrieving transcoding progress
      progressTimer=setTimeout(function ()
      {
          //Display progress bar
          ...
         //Set up the procedure of retrieving progress every 2 seconds
          TranscodeProgress = setInterval(Transcoding, 2000);
      }, 1000);
  }
  
  //The function that requests the server for retrieving the progress information every 2 seconds.
  function Transcoding()
  {
      //Calls the GetProgress action in VideoController
      $.ajax({
          url: &quot;/Video/GetProgress&quot;,
      type: &quot;POST&quot;,
      //dataType: 'JSON',
      success: function (data)
      {
          if (data.progress == undefined || data.progress == null)
              return;
          progressPerc = parseFloat(data.progress);
          //Update progress bar
          ...
      }
    });
  }
  </code></pre>
  <p>Now the Client-side code and the <code>Transcode</code> action method all work fine. The problem is that the <code>GetProgress</code> method will never get called until the <code>Transcode</code> action finishes its whole procedure. So what's wrong with my code? How can I modify it to make those two actions work spontaneously so as to achieve my goal?</p>
  <p><strong>Update</strong></p>
  <p>Based on Alex's answer, I found that my problem is caused by the session lock mechanism of Asp.Net framework. So disabling the <code>SessionState</code> of my <code>VideoController</code> or setting it as read-only does make the controller responses to the request for retrieving transcoding progress when the action method of transcoding video is being executed. But because I use <code>Session</code> in my <code>VideoController</code> to store some variables for use across multiple requests, this way couldn't be a suitable solution for my problem. Is there a better way to solve it?</p>