wait

Python subprocess Popen.communicate() equivalent to Popen.stdout.read()?

…衆ロ難τιáo~ 提交于 2019-12-17 22:09:34
问题 Very specific question (I hope): What are the differences between the following three codes? (I expect it to be only that the first does not wait for the child process to be finished, while the second and third ones do. But I need to be sure this is the only difference...) I also welcome other remarks/suggestions (though I'm already well aware of the shell=True dangers and cross-platform limitations) Note that I already read Python subprocess interaction, why does my process work with Popen

Waiting for multiple callbacks in Android

删除回忆录丶 提交于 2019-12-17 20:22:26
问题 In Java threads, you could have some number of threads in a list, start them off, and have a main thread join one, then another, going through and waiting for all processes to complete before moving on. In other models, I'm not sure how you would do that. Take the RootTools 3.0 Command class for example. You create a Command which has three methods, commandOutput , commandFinished , commandTerminated , and while you can use a callback to do something at the end of a process, I don't know how

Launch Firefox and Wait until it is Closed

会有一股神秘感。 提交于 2019-12-17 17:16:11
问题 Question I want to start the Firefox web browser as process to visit a specific website, then wait until it is closed. A special situation is that the browser may already be open and running, as the user may have visited some website already. In that case, the browser would probably open a new tab in an existing window and the newly launched process will be terminated immediately. This should not confuse my waiting process: Either, I want a new browser window (if that can somehow be enforced,

How to wait for WaitHandle while serving WPF Dispatcher events?

懵懂的女人 提交于 2019-12-17 16:41:47
问题 Someone emailed me and asked if I have a version of WaitOneAndPump for WPF. The goal is to wait for a handle (similar to WaitHandle.WaitOne) and pump WPF Dispatcher events while waiting, on the same stack frame. I really don't think an API like this should be used in any production code, either for WinForms or WPF (perhaps, besides for UI Automation). WPF doesn't expose an explicit version of WinForms' DoEvents , which is a very good design decision, given the fair share of abuse the DoEvents

How to wait for WaitHandle while serving WPF Dispatcher events?

痞子三分冷 提交于 2019-12-17 16:40:36
问题 Someone emailed me and asked if I have a version of WaitOneAndPump for WPF. The goal is to wait for a handle (similar to WaitHandle.WaitOne) and pump WPF Dispatcher events while waiting, on the same stack frame. I really don't think an API like this should be used in any production code, either for WinForms or WPF (perhaps, besides for UI Automation). WPF doesn't expose an explicit version of WinForms' DoEvents , which is a very good design decision, given the fair share of abuse the DoEvents

Bash `wait` command, waiting for more than 1 PID to finish execution

白昼怎懂夜的黑 提交于 2019-12-17 16:29:12
问题 I recently posted a question asking if it was possible to prevent PID's from being re-used. So far the answer appears to be no. (Which is fine.) However, the user Diego Torres Milano added an answer to that question, and my question here is in regards to that answer. Diego answered, If you are afraid of reusing PID's, which won't happen if you wait as other answers explain, you can use echo 4194303 > /proc/sys/kernel/pid_max to decrease your fear ;-) I don't actually understand why Diego has

Powershell Start Process, Wait with Timeout, Kill and Get Exit Code

偶尔善良 提交于 2019-12-17 16:17:57
问题 I want to repeatedly execute a program in a loop. Sometimes, the program crashes, so I want to kill it so the next iteration can correctly start. I determine this via timeout. I have the timeout working but cannot get the Exit Code of the program, which I also need to determine its result. Before, I did not wait with timeout, but just used -wait in Start-Process, but this made the script hang if the started program crashed. With this setup I could correctly get the exit code though. I am

Excel vba refresh wait

喜夏-厌秋 提交于 2019-12-17 09:44:12
问题 I am creating some code where I can click on a single button and it will refresh the querytables that I have on that sheet. Now, my problem is that I have more code after the fresh that copies some of the information, but this code is being run right after the refresh has started and the information has not yet been replaced. I want to create a waiting period for the refresh to complete and then the rest of the code can continue. I don't want to just wait for 5 seconds but for the refreshing

Timing Delays in VBA

懵懂的女人 提交于 2019-12-17 06:48:09
问题 I would like a 1 second delay in my code. Below is the code I am trying to make this delay. I think it polls the date and time off the operating system and waits until the times match. I am having an issue with the delay. I think it does not poll the time when it matches the wait time and it just sits there and freezes up. It only freezes up about 5% of the time I run the code. I was wondering about Application.Wait and if there is a way to check if the polled time is greater than the wait

How to wait for exit of non-children processes

爷,独闯天下 提交于 2019-12-17 06:11:52
问题 For child processes, the wait() and waitpid() functions can be used to suspends execution of the current process until a child has exited. But this function can not be used for non-child processes. Is there another function, which can wait for exit of any process ? 回答1: Nothing equivalent to wait() . The usual practice is to poll using kill(pid, 0) and looking for return value -1 and errno of ESRCH to indicate that the process is gone. 回答2: On BSDs and OS X, you can use kqueue with EVFILT