Is it possible to compile stack vm without heartbeat?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to compile stack vm without heartbeat?

melkyades
 
Hello guys, we've been working in porting the stack vm to native client, and we found that signals are not (yet?) supported. Because of that it's not possible to compile the sqheartbeat.c file. Is there any way to avoid having to compile it? Because the old interpreter could live without it...

Cheers,
Javier.

--
Lic. Javier Pimás
Ciudad de Buenos Aires
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to compile stack vm without heartbeat?

Eliot Miranda-2
 
Hi Javier,

On Fri, Sep 9, 2011 at 5:49 AM, Javier Pimás <[hidden email]> wrote:
 
Hello guys, we've been working in porting the stack vm to native client, and we found that signals are not (yet?) supported. Because of that it's not possible to compile the sqheartbeat.c file. Is there any way to avoid having to compile it? Because the old interpreter could live without it...

Well, yes its possible if you're prepared to modify the activation code to check for an event counter, but you really, really don't want to do that.  Preferrably you need to find an alternative.  One way is by a timer callback, and another way is via a thread looping on a delay.  Which you choose depends on the platform.  On linux we use a timer callback implemented using setitimer and signal, but only because linux doesn't current;y support multiple thread priorities in user processes.  On Mac and Windows we use a high-priority thread looping on a delay, by far the more preferrable method.  The real question to ask is "What are the timing and threading facilities provided by NaCl?".  So what does it provide in terms of timer callbacks, delays and multiple threads?  If the answer to all of these is "nothing" then you'll be forced to go with an event counter, with its attendant performance and latency problems.  ALternatively, if NaCl does provide either delays and multiple threads or timer callbacks, then implement the heartbeat in terms of those facilities.

HTH,
Eliot


Cheers,
Javier.

--
Lic. Javier Pimás
Ciudad de Buenos Aires




--
best,
Eliot