-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Description
We should use the portable timer queue when the portable thread pool has been selected. As for some of the benefits:
- The managed timer queue doesn't need to allocate when being scheduled to the thread pool since it implements IThreadPoolWorkItem
- It simplifies the native/managed interaction between the thread pool and timer queue. Today if you switch to the portable thread pool, the native timer queue needs to schedule work onto it ()
runtime/src/coreclr/vm/win32threadpool.cpp
Lines 4831 to 4843 in 7e44a6a
if (UsePortableThreadPool()) { GCX_COOP(); ARG_SLOT args[] = { PtrToArgSlot(AsyncTimerCallbackCompletion), PtrToArgSlot(timerInfo) }; MethodDescCallSite(METHOD__THREAD_POOL__UNSAFE_QUEUE_UNMANAGED_WORK_ITEM).Call(args); } else { QueueUserWorkItem(AsyncTimerCallbackCompletion, timerInfo, QUEUE_ONLY /* TimerInfo take care of deleting*/); } - The other benefits from moving to managed code (easier to maintain, same code on all platforms, etc)
I've spoke to @kouvel about this in passing so filing something just to track it.
benaadams and tibel