Can you run this codebase in a web worker? That is one simple solution to
the problem.

Otherwise, you need to refactor the code so it can be called from the
browser's main event loop, and run a fairly small chunk of work. This often
means breaking up a function into smaller functions that save their state
in some global place.

See some notes on this at
http://mozakai.blogspot.com/2012/07/bananabread-or-any-compiled-codebase.html

- Alon




On Thu, Apr 3, 2014 at 10:57 AM, nunya biznez <[email protected]> wrote:

> I have ported gnucap, an electronic simulator to emscripten. The problem I
> have now is that the script causes the browser to pop up an error when the
> script runs too long. I tried adding emscripten_set_main_loop but there is
> not really a main loop, there are several loops. If I understand correctly,
> I need to pause the script in order for the browser to respond. If there
> was a way to pause the loop just to print output,I  think it would solve
> the problem. What is the right solution to the problem ?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to