On Sat, Apr 19, 2008 at 02:49:20AM +0200, Springande Ulv wrote: > > On 19. april. 2008, at 01.57, William Ahern wrote: > >In some sense--like code complexity--using both an event-oriented > >design > >*and* threads is the worst of both worlds. Your processing logic is > >turned > >inside-out (state machines, etc, can be confusing to some people), > >plus you > >have mutexes and barriers and all that crap littered throughout your > >code. > > He he, the crack you just heard is the thin ice you walked out on.
I must be deaf. > >Premature optimization is the root of all evil.... > > Oh that is an old misunderstood meme. What Hoare actually said was "We > should forget about small efficiencies, say about 97% of the time: > premature optimization is the root of all evil." He was talking about > micro-optimizing code. Not exactly what I would call thinking about a > scalable program design, which one should think about from the start > and at all time, unless you work in the Microsoft Office team. I really couldn't care less what Hoare or anybody else said. I'm not appealing to authority. It's an apposite phrase. If you fancy all your first or even second iterations of your projects running a gigantic data center, *and* you actually meet your targets out the gate, then good for you. (Normal people would write a proof-of-concept first, and maybe second, and third.) But, in my experience it's best to aim for correctness first. If you must, you can fix most any well designed single process event-oriented daemon to scale [more] by tweaking it to use multiple processes, or multiple servers. The same more-or-less goes for threaded servers. But you usually don't need to, because as long as you're not needlessly copying data or doing other wasteful things, then you'll best any second-rate application, period. _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users