[Eventmachine-talk] next_tick efficiency

Roger Pack
Mon, 12 Nov 2007 15:55:20 -0000

It seems that next tick, when used, always consumes 100% of available
CPU.  An unexpected drawback, I''m sure.

I therefore wish that there were a function similar to next_tick that
was still quite frequent but didn''t consume so much CPU.  Setting a
timer is still only good for up to 200x/sec (so compared to next_tick,
that is far slower).

So what I wish could be built in future revisions would be something
alone the lines of
next_time_this_connections_state_changes_somehow(execute_this)
i.e. when their backpressure changes at all, you''d execute the block.
Then you wouldn''t need to poll so much (as anything does, using
next_tick), and you could still keep excellent control of your stacks
as the pressure changes.

Just my thought for the day.
Cheers!
-Roger