Mark H Weaver <m...@netris.org> skribis: > 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?
(At the risk of looking silly:) Alternately, what about documenting system asyncs as having restrictions on the type of code they can run? For example, can you think of a way to achieve what you wanted in (ice-9 popen) without resorting to system asyncs? My 2¢, Ludo’.