On Fri, Apr 18, 2008 at 2:02 PM, kr.angelov <[EMAIL PROTECTED]> wrote:
>
>  Dear All,
>
>  With this patch Yi is compiled with threaded RTS. The reason is that
>  the lightweight Haskell threads doesn't work very well when the main
>  thread is busy with the GTK main loop. Instead of forkIO we should use
>  forkOS. The problem with the latest is that this requires
>  synchronization between the worker thread and the main thread. In
>  gtk2hs there is a postGUIAsync function that does the trick for us.
>  Fortunately the only way for comunication between the editor and the
>  user interface are the functions in Yi.UI.Common. They all are wrapped
>  with postGUIAsync now.

Yi was designed so that the UI would communicate with the rest of the "world"
only through the Editor state. The "main loop" would be the only one who had
rights to call the UI, making all such threading problems impossible to get.
(afaict).

The way you called loadProject broke this convention though. Maybe we
should fix this?
Maybe even better, we should enforce the convention through the typesystem?
(I don't know how though).

>  This works for me but it is important to check whether this works with
>  the other frontends. If the VTY and Cocoa are also single-threaded
>  then they also have to be synchronized. For now I am using the OS
>  threads in shim for background compilation and it works perfect.

Vty still works fine.

Cheers,
JP.

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to