wynot12 commented on a change in pull request #73: [Nemo-62] Support Multiple Jobs Submission in a Single User Program URL: https://github.com/apache/incubator-nemo/pull/73#discussion_r203575766
########## File path: runtime/driver/src/main/java/edu/snu/nemo/driver/NemoDriver.java ########## @@ -155,14 +168,13 @@ public void onNext(final ActiveContext activeContext) { } /** - * Start user application. + * Start user DAG. */ - public void startSchedulingUserApplication(final String dagString) { - // Launch user application (with a new thread) - final ExecutorService userApplicationRunnerThread = Executors.newSingleThreadExecutor( - new BasicThreadFactory.Builder().namingPattern("User App thread-%d").build()); - userApplicationRunnerThread.execute(() -> userApplicationRunner.run(dagString)); - userApplicationRunnerThread.shutdown(); + public void startSchedulingUserDAG(final String dagString) { + runnerThread.execute(() -> userApplicationRunner.run(dagString)); + // send driver notification that user application is done. + runnerThread.execute(() -> clientRPC.send(ControlMessage.DriverToClientMessage.newBuilder() + .setType(ControlMessage.DriverToClientMessageType.ExecutionDone).build())); Review comment: We can put them into in a single runnable. Then we can easily know that the two procedures are executed sequentially, without the information that runnerThread is single-thread executor. ``` runnerThread.execute(() -> { userApplicationRunner.run(dagString); // send driver notification that user application is done. clientRPC.send(ControlMessage.DriverToClientMessage.newBuilder() .setType(ControlMessage.DriverToClientMessageType.ExecutionDone).build()); }); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services