开发者

Deadlock in c++ on solaris

开发者 https://www.devze.com 2022-12-28 20:17 出处:网络
Please, can anybody suggest me how to check for deadlock on Sola开发者_StackOverflow中文版ris with the pstack command?Your question isn\'t really related to C++, but more the general multi-threading i

Please, can anybody suggest me how to check for deadlock on Sola开发者_StackOverflow中文版ris with the pstack command?


Your question isn't really related to C++, but more the general multi-threading issue of a deadlock. When your program is running, get the pid and then in another xterm (or whatever you're using) you run pstack pid and check whether all threads are waiting for a mutex to be released. That's normally a pretty good indicator of deadlock.


Compare pstack outputs - if they are the same, and all threads are waiting for locks then you have a deadlock.

0

精彩评论

暂无评论...
验证码 换一张
取 消