c# - How to know threadid for each thread spawn by parallel.foreach -
i have scenario this
int arr[100]; parallel.foreach(arr, (a) => { processing});
now, code spawn 100 child threads, how can know thread id each child thread in "some processing" logic.
you use
thread.currentthread.managedthreadid
but note parallel foreach not forced create 100 threads.
Comments
Post a Comment