[Newbies] Using Futures in a thread other than the Morphic Thread

Jeff Gonis jgon.in.canada at gmail.com
Tue Jun 1 22:11:58 UTC 2010

Hi everyone,

I am currently experimenting with using futures in squeak as a very
convenient method for creating processes to do background work in, but a
problem I am running into is that they run in the Morphic thread it
appears.  This means that if I have a particularly long lived chunk of work
I can end up blocking the UI thread and having an unresponsive GUI.  Ideally
what I would like to do is create a future, dispatch it onto a process
running at userBackgroundPriority, and then block the UI only when I try to
get the value from the Promise that is returned.

I know that I can use a block closure and the forkAt: method to get a
process running at the userBackgroundPriority, but this doesn't give me the
nice behaviour of a Promise where I can block until completion when I
actually need the value my process will generate.

So my question is, am I missing something obvious here, or is dispatching
futures to a different thread something that is being worked on for a
"future" squeak release?

Thanks for your help,
Jeff G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100601/7b1f052a/attachment.htm

More information about the Beginners mailing list