3 ms·
Coro basically allows you to write: foo(); bar(); instead of: foo( cb => sub { bar() } ); Behind the scenes, it's basically the same thing. It's
by jrockway 17y ago
Coro basically allows you to write:
foo();
bar();
instead of:
foo( cb => sub { bar() } );
Behind the scenes, it's basically the same thing. It's cooperative so your code does not get preempted where you don't want it to be; the locking is implicit.
But you can switch to preemption and explicit locking if you desire. At that point, IMO, it's time to ditch Perl / Python / Ruby and use a language with a sane STM implementation, because locks suck.