[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: coroutine vs threads
- From: Tony Finch <dot@...>
- Date: Wed, 20 Jul 2011 14:56:01 +0100
Florian Weimer <fw@deneb.enyo.de> wrote:
>
> This description is already heavily titled to an event-based approach.
> You don't need coroutines at all for that.
Actually coroutines mesh extremely well with event-based programming.
Instead of a chain of event handlers you just write straight-line code.
The central event loop just resumes the relevant coroutines according to
the events that arrive. You can probably even use a coroutine-oblivious
core if you use coroutine.wrap.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/
Bailey: West or northwest 4 or 5, becoming variable 3 or 4 later. Moderate.
Showers. Good.