.NET "Timer" would block other method calls?
- by Ricky
Hi guys:
In ASP.NET 3.5, we suspect a delegate triggering by a "Timer" will block other method calls. From logs, some function calls will wait for the finishing of the delegate and continue to work.
Is it true? If yes, what workaround can I do?
PS: The delegate contains codes to use WCF to retrieve data and the following code
private void Replace<T>(ref IList<T> src, IList<T> des)
{
lock(src)
{
while (src.Count > 0)
{
GC.SuppressFinalize(src.ElementAt(0));
src.RemoveAt(0);
}
GC.SuppressFinalize(src);
src = des;
}
}
Thanks a lot.