> >
> isn't that a little unsafe?  resetting System.in?
> 
> What if:
>     1) The thread isn't finished with the input before you 
> set System.in 
> back
>          to it's original value (say for instance if it processes one 
> line of input
>          at a time, and then does some io over a slow network, though 
> this is
>          a bad design in general, but could happen)?
> 
>     2) You have multiple threads running which use standard 
> input (though
>          unlikely, it could happen)?
> 
> The first one is really the one to worry about.  I would think
> it's safer to just pass input like that in a file, or as command
> line arguments.
> 
Definately true on both counts (which is why I have not submitted this
formally as a patch or optional task). A side note: They options are ment to
be mutually exclusive... I only use spawn, or input; never both.  Ideally
they would be two separate tasks. If you'd like to clean it up and submit
it, be my guest.

Reply via email to