I know that there is no possibilty to distinguish any relationship between threads in the System.Thread model, but is it also not possible in the Task(Task) model?. I would like to profile a multithreaded application, the last thing I would like to do, is passing some kind of context to all my methods and threads. I would appreciate any ideas. What I would like to accomplish is similar to:
I have an good idea of capturing the execution time using Postsharp, but I would like to find out the relationship of the parent/child threads. Any ideas?
没有这样的事情,线程是线程-它没有“父”或“子”线程的任何概念。
您可能可以按照NewThreadName.CreatedByThreadName
的命名约定来命名线程,并使用System.Diagnostics.Process.Threads属性查找与该进程关联的线程。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.