[Haskell-iPhone] Thread model questions

Greg Weber greg at gregweber.info
Fri Jun 10 20:29:53 CEST 2011


Hi David,

This tutorial on parallel haskell was recently made:
http://community.haskell.org/~simonmar/par-tutorial.pdf
You are probably interested more in the concurrency
http://www.haskell.org/haskellwiki/Concurrency
aspect of what is sometimes just referred to as "Parallel Haskell"
http://www.haskell.org/haskellwiki/Parallel
There is a nice picture of the architecture of haskell threads here:
http://stackoverflow.com/questions/958449/what-is-a-spark-in-haskell

I have no idea how this plays out on the iOS. I am interested in hearing
about that.

Greg Weber

On Fri, Jun 10, 2011 at 11:12 AM, David Pollak <
feeder.of.the.bears at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> iPhone mailing list
> iPhone at haskell.org
> http://www.haskell.org/mailman/listinfo/iphone
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/iphone/attachments/20110610/aa226d60/attachment.htm>


More information about the iPhone mailing list