Does anybody know if there's a way (in C++/Windows) to check if a thread in a different process is sleeping or not?
thanks :)
Asked
Active
Viewed 951 times
1

Idov
- 5,006
- 17
- 69
- 106
-
4How can this be helpful? All this function can tell you is whether the thread was sleeping at some time between the invocation and return. – Gene Bushuyev Jan 05 '11 at 18:58
-
for profiling purposes. Is there a function like this? – Idov Jan 05 '11 at 19:02
-
@Idov: for profiling you can check the stack trace. – Yakov Galka Jan 05 '11 at 19:03
-
3how can it be useful for profiling? – Gene Bushuyev Jan 05 '11 at 19:07
-
I know, but I have this problem: http://stackoverflow.com/questions/4587065/measuring-time-of-a-profiled-sleep-function – Idov Jan 05 '11 at 19:07
-
2@ldov, based on the answers to your other question, what you're asking for doesn't exist and makes no sense. `sleep` simply does not do what you're asking it to do, and I don't think that there's any way for you to work around that without writing your own sleep function. – JSBձոգչ Jan 05 '11 at 19:24
1 Answers
0
As far as I know, there is no such API. The fact that you think you need such an API suggests that you have bigger problems. If you need to coordinate action between multiple processes, you're better off using global events.

JSBձոգչ
- 40,684
- 18
- 101
- 169