Hi,
On 09/06/2014 03:35 PM, Ben Coman wrote:
Just to be clear, by "did some calculations for an hour" do you mean the
Image basically locked up during the calculation, and the mouse clicks
were queued until the calculation ended?
exactly, after the calculation different windows spring into the
foreground, if i redo that. the strange thing though is, that the
errormessages came during the calculation and although (they added up
fast) i did not really look at them (i just cklicked them away, after
having interrupted the program) in the end they originated from the browser.
Anyhow, there are two general approaches I am familiar with.
1. Add " Processor yield " within your calculation loop.
2. Run your calculation at a priority lower than the UI. For example, "
result := nil. calculationProcess := [ result := self myCalculation ]
forkAt: Processor userBackgroundPriority " , then periodically test for
" result ~= nil " , maybe from a "step" method in your own subclass of
some Morph.
and what do i do after 'result ~= nil' ? <stupid grin>
and what is the disadvantage of the simple first solution, i have to
admit i never looked at these fork things?
werner