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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -