From owner-freebsd-java@FreeBSD.ORG Tue Jun 28 06:38:12 2005 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B5EC16A41C for ; Tue, 28 Jun 2005 06:38:12 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 856E343D1F for ; Tue, 28 Jun 2005 06:38:11 +0000 (GMT) (envelope-from achill@matrix.gatewaynet.com) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id j5S6PDBS013316; Tue, 28 Jun 2005 09:25:13 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id j5S6PCjn013312; Tue, 28 Jun 2005 09:25:12 +0300 Date: Tue, 28 Jun 2005 09:25:12 +0300 (EEST) From: Achilleus Mantzios To: Ronald Klop In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT Cc: freebsd-java@freebsd.org Subject: Re: Wierd problem in linux 2.4.18-bf2.4, Java Blackdown-1.4.2-rc1 (Solved) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2005 06:38:12 -0000 O Ronald Klop έγραψε στις Jun 27, 2005 : > On Mon, 27 Jun 2005 11:14:14 +0200, Achilleus Mantzios > wrote: > > > > > Forgot my homework.... > > A classic (lack of) consumption of output situation, > > > >> From the java docs: > > > > The Runtime.exec methods may not work well for special processes on > > certain native platforms, such as native windowing processes, daemon > > processes, Win16/DOS processes on Microsoft Windows, or shell scripts. > > The > > created subprocess does not have its own terminal or console. All its > > standard io (i.e. stdin, stdout, stderr) operations will be redirected to > > the parent process through three streams (Process.getOutputStream(), > > Process.getInputStream(), Process.getErrorStream()). The parent process > > uses these streams to feed input to and get output from the subprocess. > > Because some native platforms only provide limited buffer size for > > standard input and output streams, failure to promptly write the input > > stream or read the output stream of the subprocess may cause the > > subprocess to block, and even deadlock. > > > > > > Sorry for the noise, the situation can pretty well > > occur in FreeBSD too when pipe output buffer reaches its limit, > > and at the end of the day i think someone maybe will find this > > useful in the future. > > I always create two threads to copy the output of stdout and stderr to > some place. (/dev/null or a file or System.out). In java 5 you can combine > stdout and stderr, so you only need 1 thread. > Right, altho doing > dev/null 2>&1 in the script itself, saves the extra code. > > > -- -Achilleus