.net - How to Monitor C# Threads from another Thread -


i have several threads running in threadpool in wpf app. need monitor them, possibly thread find out if of threads have terminated. how able achieve this.

for simplicity, usage scenario is:

  1. click button
  2. start several threads in threadpool.
  3. start thread monitor in threadpool
  4. lock ui of wpf app.
  5. release lock when thread in step 3 sets global value indicate threads started in (2) have terminated.

put threads in threadpool in array. when want wait pool threads exit, use waithandle.waitall wait threads complete.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -