[Unison-hackers] About the current OS X GUI hanging

Benjamin Pierce bcpierce at cis.upenn.edu
Tue Jan 23 09:21:17 EST 2007


Aha -- thanks, Alan!  That definitely helps.

So it seems clear (without looking at the code, which I don't  
understand in any detail) that what's happening is:

   - GUI thread calls OCaml to process a transfer instruction  
(grabbing the lock)
   - OCaml calls back to GUI to update the "done" information
   - GUI thread needs to look up some bit of information from the  
OCaml data structure to know how to update the screen, so it tries to  
call back into OCaml, but now gets stuck because the lock is already  
held

So I guess the next question is whether it is OK simply to release  
the lock when the callback happens (and re-acquire it on the  
recursive call to OCaml), or if this is not safe because it might  
lead to a *different* GUI thread acquiring the lock and making a call  
into OCaml instead.

(I have a feeling it might not be safe: if there is a saved call  
stack on the OCaml side, then it seems like we need to return from  
callbacks in the order that they were made.  In which case we might  
fix the hang by making the lock re-entrant -- i.e., turning the lock  
into a counter and keeping track of the thread that is currently  
holding it.)

Trevor?  Ben?

    - B



On Jan 23, 2007, at 4:31 AM, Alan Schmitt wrote:

> Hello,
>
> I have noticed something that might help: the time when the GUI  
> hangs on OS X is when it needs to update the column where it shows  
> the update percentage and the "done" information, but only when it  
> is in the visible part of list.
>
> To reproduce: have many things to synchronize, scroll down to the  
> bottom, and start synchronization. When Unison hangs, the line  
> showing what file has started synchronizing should correspond to  
> the one at the top of the window (or the one just before if it's  
> partially displayed).
>
> Alan
>
> --
> Alan Schmitt <http://alan.petitepomme.net/>
>
> The hacker: someone who figured things out and made something cool  
> happen.
>  .O.
>  ..O
>  OOO
>
>
>
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers



More information about the Unison-hackers mailing list