[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: System asyncs and mutexes: a combination prone to deadlocks
From: |
Mark H Weaver |
Subject: |
Re: System asyncs and mutexes: a combination prone to deadlocks |
Date: |
Fri, 23 Aug 2013 17:18:54 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
I wrote:
> System asyncs can run while mutexes are locked. Asyncs can run
> arbitrary scheme code, so of course mutexes will often be locked within
> asyncs as well. So what happens if an async tries to lock a mutex that
> has already been locked by the same thread? Deadlock, of course.
I've mulled this over, and I think the solution will involve finding all
of the mutexes that are likely to be locked within asyncs without the
user's knowledge (i.e. essentially all mutexes used in core Guile, both
in C and in Scheme), and ensuring that asyncs are disabled before any of
those mutexes are locked.
What do you think?
Mark