From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-developers@cygwin.com
Subject: Re: deadlock on console mutex in gdb
Date: Thu, 13 Jan 2022 19:56:46 +0900 [thread overview]
Message-ID: <20220113195646.7cac402c3e8e9077ab7789d2@nifty.ne.jp> (raw)
In-Reply-To: <87mtkribfg.fsf@gmail.com>
Sorry for being absent for a long time.
On Thu, 23 Dec 2021 11:32:51 -0400
David McFarland wrote:
> Takashi Yano <takashi.yano@nifty.ne.jp> writes:
>
> > I think there is no other way than not to wait mutex in the
> > debugger process. If anyone have any other idea, please let
> > me know.
>
> I have a few thoughts:
>
> I believe gdb currently just uses windows debugging APIs, so it doesn't
> treat cygwin as an operating system. On other operating systems there
> would be some mechanism to prevent kernel mutexes from deadlocking. It
> obviously can't just wait for all syscalls to complete, but it must
> avoid blocking kernel tasks that hold mutexes. Perhaps we could do
> something similar on cygwin, but it would probably mean providing
> cygwin-specific debugging APIs and support in gdb. I'd have to do some
> more research into how this works on e.g. Linux.
>
> Can we avoid using inter-process mutexes for this? What would you expect
> to break if we just used a per-process mutex?
I think we need inter-process mutex. Otherwise, write() calls
from multiple process will not be done in atomic.
> If we do need an inter-process mutex, perhaps we could have a daemon
> process responsible for it? I think that would be a bit of a departure
> for cygwin.
I cannot imagine how to implement this...
--
Takashi Yano <takashi.yano@nifty.ne.jp>
prev parent reply other threads:[~2022-01-13 10:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 15:26 David McFarland
2021-12-22 20:44 ` Takashi Yano
2021-12-22 22:17 ` David McFarland
2021-12-23 9:24 ` Takashi Yano
2021-12-23 15:32 ` David McFarland
2021-12-23 19:28 ` David McFarland
2021-12-26 15:25 ` David McFarland
2022-01-13 11:09 ` Takashi Yano
2022-01-13 10:56 ` Takashi Yano [this message]
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=20220113195646.7cac402c3e8e9077ab7789d2@nifty.ne.jp \
--to=takashi.yano@nifty.ne.jp \
--cc=cygwin-developers@cygwin.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).