[Haskell-iPhone] Thread model questions

David Pollak feeder.of.the.bears at gmail.com
Fri Jun 10 20:12:15 CEST 2011


Howdy,

I've got a question about threading and thread models in ghc-iphone.

My understanding is that Haskell has its own threading model that under the
covers uses OS threads, but allows for significantly more active threads.
Is this a correct understanding?  If so, how does the Haskell threading
model work on the iPhone?  Is it that iOS is close enough to OS X/Darwin
that it "just works"?

If it "just works", then how does one marshal an event back onto the iOS "UI
thread" so that the display or draw or whatever command can take place on
the UI thread?  Is there a convention or recipe for doing so?  Would it be
possible to put an event on the UI event queue that applies an Haskell
closure such that the Haskell code that contains the computed value (I'd
force the computation before marshaling the event to minimize the actual
delay on the UI thread) then mutates the UI based on the computed value?

Given the 5 second rule about an iOS app getting shut down... if there are
Haskell threads doing Haskell-y kind of work, is there a way of notifying
those threads en masse about the shutdown?

Thanks,

David

-- 
Lift, the simply functional web framework http://liftweb.net
Simply Lift http://simply.liftweb.net
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/iphone/attachments/20110610/7a192e4a/attachment.htm>


More information about the iPhone mailing list