Skip to content

Lock convoy on TimerQueueTimer #8646

@maximburyak

Description

@maximburyak

Hi,
Here: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Threading/Timer.cs#L555 you lock on a static field. Under a certain load of timers, you can get a very annoying lock convoy. It's not that easy to reproduce, but it happes.
There's a bigger chance to reproduce especially under big amount of thread pool threads, so there are a lot of these stacks:

System.Threading.TimerQueueTimer.Fire()
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
System.Threading.ThreadPoolWorkQueue.Dispatch()

preventing from themselves and other timers to operate or even being created

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions