Use System.Threading.Timer with CustomThreadPool?
Do not use System.Threading.Timer
, no. Usage System.Timers.Timer
I suppose you could if the appropriate thread pool implemented ISynchronizeInvoke
accordingly. I believe the timer will call BeginInvoke
on its own SynchronizingObject
to execute the callback accordingly. If the thread pool has implemented ISynchronizeInvoke
to mean "add callback to work queue", it should work fine.
(Mine doesn't implement it, but it probably won't be too hard to do. My thread pool is very primitive, or at least very old! - there are almost certainly better ones available now.)
source to share