I'm creating a webservice where ZIP-files are generated. Each time a user requests 'downloadzip.ashx', this thread is created:
Thread t = new Thread(() => generateZIP(maxlat, maxlon, minlat, minlon, app, context, downloadid, rootdirectory, rstring));
t.Start();
if (!t.Join(TimeSpan.FromSeconds(120)))
{
t.Abort();
updateQueue(downloadid, 3);
context.Response.Write("timeout");
}
This works fine, but when I request url 'downloadzip.ashx' several times, sometimes it takes a minute before the thread starts...