mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Starks <John.Starks@microsoft.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: RE: Deadlock when calling fflush/fclose in multiple threads
Date: Fri, 2 Nov 2018 15:37:18 +0000	[thread overview]
Message-ID: <CY4PR21MB0119A3F3CC15F7D74A1D734DE0CF0@CY4PR21MB0119.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20181102153352.GH5150@brightrain.aerifal.cx>

> 
> I think such an approach is plausible, but involves the kind of
> complex and error-prone direct use of atomics I'm actively trying to
> eliminate. The same could be done without low level hacks via clever
> use of rwlocks or a mutex+condvar pair, but all of these involve
> namespace-safety issues and a lot more code than should be introduced
> into minimal static programs using stdio.
> 
> For what it's worth, the only consumers of the open file list that can
> be executed more than once are fflush(NULL), fclose, and __ofl_add
> (used by fopen, etc.).
> 
> Rich

Yeah, I can see the desire to avoid additional complexity. It would be a shame, though, for fopen or fclose of a local file to block behind flushing during an fclose of a file on a network file system, for example.


  reply	other threads:[~2018-11-02 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2018110213110009300613@kooiot.com>
2018-11-02 14:29 ` Rich Felker
2018-11-02 15:15   ` John Starks
2018-11-02 15:33     ` Rich Felker
2018-11-02 15:37       ` John Starks [this message]
2018-11-02 15:46         ` Rich Felker
2018-11-02 15:45   ` Rich Felker
2018-11-02 15:59 dirk
  -- strict thread matches above, loose matches on Subject: below --
2018-11-02  5:11 dirk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR21MB0119A3F3CC15F7D74A1D734DE0CF0@CY4PR21MB0119.namprd21.prod.outlook.com \
    --to=john.starks@microsoft.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).