1 May 01:05
Re: boost coroutine status
OvermindDL1 <overminddl1 <at> gmail.com>
2009-04-30 23:05:20 GMT
2009-04-30 23:05:20 GMT
On Thu, Apr 30, 2009 at 3:33 PM, Nat Goodspeed <nat <at> lindenlab.com> wrote: >>> I looked at this library a few years ago before I wrote my own (for a >>> windows system), > > I'm curious how you did that? Assembly code? Yep, and a lot of scaffolding, it is not an easy-drop in thing, but it ran fast and supported an Actor based programming model (which is what I was going for, which means that 10k little coroutines may be a small number in many cases, fibers choke and die). A lot of work to program a new coroutine, but it worked well. Not something anyone else would want to use though (although much of the scaffolding that had to be repeated could be done using templates now that I know those well enough know). On Thu, Apr 30, 2009 at 3:33 PM, Nat Goodspeed <nat <at> lindenlab.com> wrote: >>> and the big problem I saw with it was that it uses >>> fibers on windows. Fibers have this little problem, if you say you >>> need, say, 20kb for the fiber stack, it still allocates as much memory >>> as a thread uses (4megs by default I think), meaning if you try to >>> create 10k of these little buggers, you run out of memory well before >>> that. Made this library rather worthless for my use. > > Heh, my own use case involves a far smaller number of coroutines, so this > isn't such a problem from my POV. You should try the Actor Programming Model, pretend there is no global state (unless you know for certain of no issues), create an atomic CAS based scheduler to switch between the coroutines/actors, etc... It scales well, works on multiple threads (with actors able to be(Continue reading)
RSS Feed