Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32854

Re: interruptable process?

Newsgroups comp.lang.java.programmer
Date 2015-10-09 09:08 -0700
References (8 earlier) <mv6l4j$uq9$1@dont-email.me> <mv74cs$hd4$1@dont-email.me> <mv8244$ssp$1@dont-email.me> <bc418cf4-d955-44e2-92cd-3e4629d4f54f@googlegroups.com> <mv8gr1$f6v$1@dont-email.me>
Message-ID <a68b778e-6979-4dff-b472-8bfad753cec1@googlegroups.com> (permalink)
Subject Re: interruptable process?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Friday, October 9, 2015 at 9:54:56 AM UTC-4, Martin Gregorie wrote:
> I was wondering if, given that you may need to build a client process to 
> control the render process, if it might make sense for that to also be 
> used to submit and/or remove files to be rendered. That might be better 
> for the user(s) as there's only one tool to understand.
> 
> > I just need to find the code to terminate a render process started 
> > from Java.
> > 
> Yes. Question for you: does the rendering program provide any way to stop 
> it in mid-render apart from killing the process?
> 
> If it doesn't, a clean way to solve that would be something like the two 
> thread Java server I suggested. One type of thread runs renderers via 
> ProcessBuilder.start() class and can stop them via Process.destroy(). The 
> other type accepts requests from users. 'Stop' requests causes it to 
> remove a render request from the queue if it hasn't yet started or passes 
> it to the render thread if the job is running. That thread can kill the 
> current render process via Process.destroy() and start the next render 
> job via ProcessBuilder.start().
>  
Java is starting the render using ProcessBuilder which executes Blender.exe and passes it a python script which has the actual render command which starts a second Blender.exe task.  I tried Process.destroy() and it killed the first task and left the second Blender process running, though these two tasks must be communicating because we do redirect the output from the task ProcessBuilder started and it is logging every step.  It appears Blender doesn't provide a kill command, so the only way I can see so far to end this task is to use a Java command or Windows tool that can get a list of all running processes and search for Blender.

> >> Question for the OP: it appears that any user can add blender tasks to
> >> the queue, but can any user kill the current blender task regardless of
> >> who submitted it?
> > 
> > Currently it is just one user submitting new blend files but allowing
> > multiple users to submit and specifying who can terminate what could be
> > something to consider.
> >
> The rendering control server may be a bit easier to implement if, as Jeff 
> suggested, each request has a ticket no. and the requests are managed by 
> a Queue instance which stores pending requests until the render thread is 
> ready for them.

That does seem like a good idea for later enhancement, once I get a remote access tool able to abort a render, to use that tool to start renders instead of the current procedure to drop blend files into a folder.  Then they can set the order they want things to render, and I can show the progress of the current task.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-08 05:27 -0700
  Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 09:50 -0400
    Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-08 07:39 -0700
      Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 14:27 -0400
        Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-08 11:58 -0700
          Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 15:10 -0400
          Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 15:22 -0400
            Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-08 12:40 -0700
              Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 16:21 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 16:55 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-08 21:15 -0400
                Re: interruptable process? Martin Gregorie <martin@address-in-sig.invalid> - 2015-10-09 09:41 +0000
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 05:12 -0700
                Re: interruptable process? Martin Gregorie <martin@address-in-sig.invalid> - 2015-10-09 13:52 +0000
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 09:08 -0700
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 12:43 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 13:23 -0400
                Re: interruptable process? Jan Burse <janburse@fastmail.fm> - 2015-10-09 18:26 +0200
                Re: interruptable process? Jan Burse <janburse@fastmail.fm> - 2015-10-09 18:30 +0200
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 10:31 -0700
                Re: interruptable process? Martin Gregorie <martin@address-in-sig.invalid> - 2015-10-09 23:13 +0000
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-12 05:09 -0700
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 10:25 -0700
                Re: interruptable process? Jan Burse <janburse@fastmail.fm> - 2015-10-09 20:04 +0200
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 11:23 -0700
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 11:30 -0700
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 08:38 -0400
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 05:18 -0700
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 08:46 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 08:59 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 11:06 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 13:54 -0400
                Re: interruptable process? Jeff Higgins <jeff@invalid.invalid> - 2015-10-09 14:59 -0400
                Re: interruptable process? Eric Douglas <e.d.programmer@gmail.com> - 2015-10-09 12:13 -0700

csiph-web