From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22458 invoked by alias); 25 Apr 2011 16:41:48 -0000 Received: (qmail 22421 invoked by uid 22791); 25 Apr 2011 16:41:44 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_FC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 16:41:31 +0000 From: "jb at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/25830] [libgfortran] Optionally support multi-process locking X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jb at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 25 Apr 2011 16:41:00 -0000 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: 2011-04/txt/msg02532.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25830 --- Comment #4 from Janne Blomqvist 2011-04-25 16:41:26 UTC --- Some writings arguing that POSIX locking is more or less fundamentally broken: http://0pointer.de/blog/projects/locking.html http://0pointer.de/blog/projects/locking2.html http://www.samba.org/samba/news/articles/low_point/tale_two_stds_os2.html AFAICS, if gfortran is to eventually support multi-image IO in the context of Co-array Fortran as in the TR http://j3-fortran.org/doc/meeting/192/10-166.pdf , it is possible to implement all of this without relying on POSIX locking (fcntl) for synchronization, instead using the existing IPC channels that co-arrays provide. That being said, it might be necessary to do a fcntl lock+unlock at appropriate places in order to force the NFS client to flush dirty bytes to the server; alternatives to using fcntl() to force NFS flushing is fsync or a close+reopen of the POSIX file descriptor. Close+reopen does have the nice property of being portable and not relying on a working NFS locking implementation. FWIW, one strange thing about the 10-166 TR is that there is no mention of stream access, which AFAICS is suited to parallel access just like direct access.