On Fri, 19 Jan 2007, alessioc wrote:
..... reformatted ....
> I'm coding a multithreaded java program where threads do mainly two
> things: some of them open an HTTPS connection (with a custom
> X509TrustManager), other execute a shell script (through Runtime.exec).
> I noticed that often the JVM hangs during the fork process (caused by
> Runtime.exec), and the jstack of the forked JVM process is always the
> same:
.... snip .....
Not answering your question directly, but I can tell you, from experience,
that this approach is not likely to result in a long term, stable and
trouble-free application implementation. A better approach to this
challenge, is to setup your C based code as a separate server type
process, which listens on a socket. Then devise a simple (as simple as
possible) convention to pass data between your Java (based) and C based
processes.
The overhead of passing the data over a socket connection is so small that
its really insignificant and _much_ lower than forking etc.
The above approach applies to migrating legacy applications to Java - it
allows you to keep the core routines that run fast as C-code, completely
separated from your Java code. Also, it allows additional deployment
flexibility - since the C based server can be moved to another computer
system and you can run multiple "copies" of it and use Server Load
Balancing to scale the application or simply to gain increased
reliability/availability by runing multiple "copies" on separate systems.
Likewise its simple to "socketify" Perl, Python, Tcl based code and
leverage it from Java.
HTH and email me offlist if you have additional questions.
Regards,
Al Hopper Logical Approach Inc, Plano, TX. [EMAIL PROTECTED]
Voice: 972.379.2133 Fax: 972.379.2134 Timezone: US CDT
OpenSolaris.Org Community Advisory Board (CAB) Member - Apr 2005
OpenSolaris Governing Board (OGB) Member - Feb 2006
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code