wait

Wait for all jobs of a user to finish before submitting subsequent jobs to a PBS cluster

夙愿已清 提交于 2019-12-04 07:23:10
I am trying to adjust some bash scripts to make them run on a ( pbs ) cluster. The individual tasks are performed by several script thats are started by a main script. So far this main scripts starts multiple scripts in background (by appending & ) making them run in parallel on one multi core machine. I want to substitute these calls by qsub s to distribute load accross the cluster nodes. However, some jobs depend on others to be finished before they can start. So far, this was achieved by wait statements in the main script. But what is the best way to do this using the grid engine? I already

Java Wait Function

佐手、 提交于 2019-12-04 06:22:38
问题 I was wondering if you guys could help me out. I'm trying to make an animation program with Java's built in graphics module... The thing is, Java executes everything at once; there isn't any time between the different animations. The end product is just the last picture. I need a function that puts like half a second in between each of the pictures. Any help is appreciated. Specs: Blue-J, JDK 6. Edit: Btw, I'm a Java Newbie, and this is a class thing. The assignment was to make an animation,

How to not wait for something with Watir-Webdriver

岁酱吖の 提交于 2019-12-04 05:30:42
问题 So I'm writing a watir-webdriver script, and my app is using javascript to present a modal window that I want to interact with. When I click the element that presents the modal window, watir-webdriver just sits there until eventually it times out and i see a Timeout::Error on the console window. This is before attempting to interact with the new window at all. I'm assuming it's polling the DOM for some change and not getting it, how do I tell it to move on without waiting? 回答1: The answer

How to use wait and notify protocol with multiple threads

 ̄綄美尐妖づ 提交于 2019-12-04 05:15:37
Specifically, can somebody tell me what is wrong with this piece of code. It should start the threads, so should print "Entering thread.." 5 times and then wait until notifyAll() is called. But, it randomly prints "Entering.." and "Done.." and still keeps waiting on others. public class ThreadTest implements Runnable { private int num; private static Object obj = new Object(); ThreadTest(int n) { num=n; } @Override public void run() { synchronized (obj) { try { System.out.println("Entering thread "+num); obj.wait(); System.out.println("Done Thread "+num); } catch (InterruptedException e) { e

A better way to wait for a variable to change state in VB.Net

不羁岁月 提交于 2019-12-04 05:12:44
问题 I have a loop that goes through a number of values. With every value iterated, a page is loaded in a webbrowser control (with the value passed as a parameter) and when the page is loaded and read, the loop should go to the next value in the list and continue until all values are processed. I need a way to pause the procedure while the website is loading asynchronously and then resume once the page loading/reading process is complete. The way I am doing is by using something like this, where

Using BackgroundWorker to complete two methods one after the other WPF/C#

二次信任 提交于 2019-12-04 04:53:43
问题 In my program I have two methods that takes a while to complete, about few minutes each. While these methods are being executed, I display a Progress Bar in a separate window which shows the progress of each method. My two methods are in a static Utility class. They look like the following: public static class Utility { public static bool TimeConsumingMethodOne(object sender) { for (int i = 1; i <= 100; i++) { Thread.Sleep(100); (sender as BackgroundWorker).ReportProgress(i); } return true; }

How to make main window wait until a newly opened window closes in C# WPF?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 04:45:56
I am new to WPF as well as C#, please bear with me. I have a main window which opens up a new window. Now this new window is a prompt whether or not to overwrite a file, and the main window accesses a public variable in the new window to check for the prompt's result. But I can't get the main window processing to wait until the new window closes. Window1 Win = new Window1(); Win.Show(); if (Win.pr_res == 1) { abc.Text = "File to be overwritten"; File.Delete(_destination); Start(); } else { abc.Text = "Operation Aborted"; } I tried adding a while loop checking another public boolean in the main

Wait until a certain process (knowing the “pid”) end

偶尔善良 提交于 2019-12-04 02:47:18
问题 I have this: def get_process(): pids = [] process = None for i in os.listdir('/proc'): if i.isdigit(): pids.append(i) for pid in pids: proc = open(os.path.join('/proc', pid, 'cmdline'), 'r').readline() if proc == "Something": process = pid return process def is_running(pid): return os.path.exists("/proc/%s" % str(pid)) Then i do this: process = get_process() if process == None: #do something else: #Wait until the process end while is_running(process): pass I think this is not the best way to

How can I make Perl wait for child processes started in the background with system()?

孤街浪徒 提交于 2019-12-04 02:20:34
I have some Perl code that executes a shell script for multiple parameters, to simplify, I'll just assume that I have code that looks like this: for $p (@a){ system("/path/to/file.sh $p&"); } I'd like to do some more things after that, but I can't find a way to wait for all the child processes to finish before continuing. Converting the code to use fork() would be difficult. Isn't there an easier way? Using fork/exec/wait isn't so bad: my @a = (1, 2, 3); for my $p (@a) { my $pid = fork(); if ($pid == -1) { die; } elsif ($pid == 0) { exec '/bin/sleep', $p or die; } } while (wait() != -1) {}

Boost MSM parallel behavior with delayed self-transitions?

核能气质少年 提交于 2019-12-04 02:04:21
问题 I am using Boost MSM (basic and functor front-ends) and am trying to implement the following state machine: In words: Enter state State1 Enter state A and execute action_A. After 2 seconds, print "Trying again..." and re-execute state A (i.e. call its entry action). This loops forever... At the same time as 2 (i.e. "in parallel"), enter state B and execute action_B. After 5 seconds, print "Trying again..." and re-execute state B (i.e. call its entry action). This loops forever... I would like