title: While multi-threading in JS -- time latency shows up in fluent message dispatching
body: <p>I'm using multi-threading in my web-application to render some geometric
  diagrams involving (very) long loops.</p>
  
  <p>During early (and raw) implementations, I found that reducing the number of
  parameters being passed from the multi-threader to the related
  listener really sped up the whole loop.  It also let the web application dispatch the events queue with fluency, so that the onclick event halts as I click the mouse button down. It works great, as it's expected to in these cases.</p>
  
  <p>Now I am programming a new situation involving parsing user-defined formulas.  Say 'z^2-z+1' for example, inside the same long loops as mentioned before.</p>
  
  <p>I expected the parser to slow down the dispatching of messages from the multi-tasker to the listener, but I can't figure out the reason why the same onclick event is being processed quite later after the mouse button has been pushed.</p>
  
  <p>It seems that <strong>the parser itself is out of sync with the multi-threader dispatch process</strong>, causing long time intervals of latency delays, where events can't be processed immediately as usual.</p>
  
  <p>Increasing the number of messages sent from the multi-tasker to the listener
  didn't work as well as decreasing the number of messages. In the first case, I failed to guarantee a frequent exchange of messages due to the counter-effect of making the loop running quite slower and due to the high number of messages sent to the listener.</p>
  
  <p>On the contrary, decreasing such number affected the communication from multi-tasker to listener because few events are sent and so they are then processed a long later.</p>
  
  <p>Naturally, according to my early success, the number of parameters passed to the listener remained the same.</p>
  
  <p>It seems I'm facing a different aspect of the same problem and I guess I should find the way to forward some stopping command to the parser.</p>
  
  <p>Any trick to keep the events queue dispatching fluently again ?</p>
  
  <p>Thank you</p>