From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10738 invoked by alias); 15 Nov 2008 19:15:20 -0000 Received: (qmail 29250 invoked by alias); 15 Nov 2008 19:13:52 -0000 Date: Sat, 15 Nov 2008 19:15:00 -0000 Message-ID: <20081115191352.29249.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/38122] "file already opened in another unit" error when opening /dev/null or /dev/tty twice In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jvdelisle at verizon dot net" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-11/txt/msg01232.txt.bz2 ------- Comment #7 from jvdelisle at verizon dot net 2008-11-15 19:13 ------- Subject: Re: "file already opened in another unit" error when opening /dev/null or /dev/tty twice > Which OP? The originator of the c.l.f thread or the originator of > this bug report. Originator of this bug report. And what I am trying to say is that the NONMEM folks could write their code so that it does not violate the standard and deals with any need for multi-threading. > > As Tobias points out, attaching 2 or more unit numbers to the same > file would open gfortran to race conditions. Agree, don't attach 2 or more unit numbers to the same file. I have written rudimentary multi-tasking and multi-threading code myself even when not supported by the OS. Yes, its extra work and most system programmers would cringe at the thought of doing that in Fortran. Respectfully, the NONMEM team needs to fix their code. > $0.02 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38122