WiFi Network causing unpredictable stalls

milo_mindbender:
So what I have is a main loop that begins with a piece of code something like if(time_since_last_run < 10ms) return;
...
When there is a stall there might be no packets sent for .13 seconds, then a [burst] of packets and acks will come very quickly in considerably less than .01 seconds.
...

Does this sound like anything you have encountered before? Am I missing some TCP parameters that could be tuned to make this work better?

Speaking generally, rather than Arduino in particular, it's the sort of symptoms I associate with a network I/O function being called re-entrantly.

You can avoid re-entrancy using a static flag.

void foo(unsigned long time_since_last_run) {
  static bool busy = false;
  if (busy || (time_since_last_run < 10ms)) return;
  busy = true;

  // i/o stuff...

  busy = false;
  return;
}