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


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

Re: interruptable process?

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: interruptable process?
Date 2015-10-09 13:52 +0000
Organization A noiseless patient Spider
Message-ID <mv8gr1$f6v$1@dont-email.me> (permalink)
References (7 earlier) <mv6j5h$n84$1@dont-email.me> <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>

Show all headers | View raw


On Fri, 09 Oct 2015 05:12:15 -0700, Eric Douglas wrote:

> On Friday, October 9, 2015 at 5:43:48 AM UTC-4, Martin Gregorie wrote:
>> How about two user threads? One to process entries on a queue of
>> blender requests and the other to monitor a socket for blender requests
>> and action them [add/delete queue entries and, on request, kill the
>> current blender process].
>> 
> Currently it's just a render folder and an output folder.  Java checks
> the render folder on an infinite loop with a 30 second pause for new
> things to render one at a time, renames input when done so it doesn't
> get picked up again.
>
Yes, I realised that you are using something like that.

> There is no queue.  If there are multiple files
> they're likely getting picked up alphabetically.
>
Conceptually thats a queue of waiting render jobs.

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().
 
>> 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.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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