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>,
	"dirk@kooiot.com" <dirk@kooiot.com>
Subject: RE: Deadlock when calling fflush/fclose in multiple threads
Date: Fri, 2 Nov 2018 15:15:51 +0000	[thread overview]
Message-ID: <CY4PR21MB0119987BFCD012EB4F6A31B1E0CF0@CY4PR21MB0119.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20181102142915.GG5150@brightrain.aerifal.cx>

> 
> I think we just have to move the __ofl_lock to the top of the
> function, before FLOCK, and the __ofl_unlock to after the
> fflush/close. Unfortunately this makes fclose much more serializing
> than it was before, but I don't see any way to avoid it.
> 

Perhaps you could keep a global count of FILEs that are still being flushed after having been removed from the list. fflush could perform a futex wait on this becoming 0.


  reply	other threads:[~2018-11-02 15:15 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 [this message]
2018-11-02 15:33     ` Rich Felker
2018-11-02 15:37       ` John Starks
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=CY4PR21MB0119987BFCD012EB4F6A31B1E0CF0@CY4PR21MB0119.namprd21.prod.outlook.com \
    --to=john.starks@microsoft.com \
    --cc=dirk@kooiot.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).