This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: initialize ProcessManager early
Tom Tromey writes:
> >>>>> "David" == David Daney <ddaney@avtrex.com> writes:
>
> David> 1) Programs that never directly or indirectly do Runtime.exec() are
> David> now burdened with the weight of an extra thread.
> David> 2) Startup time for all programs will now be slower because this extra
> David> thread is created sooner that it used to be.
>
> Yeah, good points.
>
> I'm not sure what else to do though.
>
> My Plan B was to rearrange startup so that the user thread is not the
> primary thread. Then libgcj worker threads would not descend from the
> user thread, circumventing this problem.
>
> But for this approach to work, we have to start another new thread
> anyway.
>
> Hmm, maybe I could make the ProcessManager thread a child of the
> finalizer thread. That might work.
You have to wonder whether Java's Process / Streams interface is
really a sensible way to spawn a process that does name lookup for
stack traces . An earlier version of this name lookup code was
written in C++ and didn't use Process at all. Much more lightweight,
smaller, faster, etc. And, most importantly, you don't want a
diagnostic to have side-effects on the system you're diagnosing.
Andrew.