On 2005-07-20, Simon Marlow <[EMAIL PROTECTED]> wrote:
> You could forkIO the main loop if you want; it shouldn't make any
> difference, except that GHC terminates the program when the main thread
> completes, so it's more convenient to have the main loop run in the main
> thread, so that the program terminates when the main loop returns.

Here's my concern.

I assume that, internally, forkIO is implemented using poll() or
select().  This obviously requires that all parts of the program
cooperate with this mechanism.  If this mainloop never returns (that is,
it blocks until the UI is destroyed), how do other forkIO'd threads ever
get a chance to run?

Assuming my program uses only forkIO threads, does the C library really
need to be thread-safe?

-- John

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to