I have a thread that dequeues data from a queue and write it to another application's STDIN. I'm using Stream, but with .Write and even .BeginWrite, when I send 1mb chunks to the second app, my GUI gets laggy for ~1sec. Why? My callbacks are something like this:
void Progress(object sender, ProgressArgs e) {
if (this.InvokeRequired) {
this.BeginInvoke(new MethodInvoker(delegate() { Progress(sender, e); }));
return;
}
progressBar1.Value = (int) e.PercentDone;
}