From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <009301c0cd2d$f27944b0$b30096c2@SOMA> From: "Boyd Roberts" To: <9fans@cse.psu.edu> References: <20010423112013.6119519A2E@mail.cse.psu.edu> <3AE55C5E.AF41512F@hotmail.com> Subject: Re: [9fans] X on Plan 9 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Wed, 25 Apr 2001 04:17:57 +0200 Topicbox-Message-UUID: 8e8c23d6-eac9-11e9-9e20-41e7f4b1d025 event driven programming is fraught with peril; you have to maintain state and interpret/modify it based on events that arrive at some of the worst possible times. eg. winsock 1 would sometimes send you write true messages before connect true. so you'd add all these extra 'states' to your switch statement. some winsock apps would loop on write true rather than connect true. #define makestate(s, e) ((long)((s) << 16 | (e))) saves you from '14 page switch statements'. kernel hacks are a bit thin on the ground now, and the kernel is one of the worst things to debug. the number of vax la-120 stack backtraces and adb's on the kernel crash dumps i've analysed is more than i'd like to remember. the 11/780 had an interesting property; the first 64Kb of ram was zeroed on boot. this was all very fine until the text pushed the reiser? written bitmap of free pages above the first 64kb. the bitmap was never zeroed and you'd get dup frees and all sorts of horrible stuff. that was hard. two weeks of crash dump analysis and all nighters to fix it. finally, movc5 city on some weird area mapped by the SPT. motto: keep the kernel small and make it possible to do all the 'kernel' stuff in user mode. a crash can leave you with virtually nothing; smashed file-systems, pissed off users, backup scrambles -- ouch. one of the reasons i had a bottle of [kernel hacker's] jack daniels on top of my viewpoint vp90 terminal. take a slug, wander the corridors [with bottle] and think about the problem. -- Boyd Roberts boyd@planete.net [trouble] seems to know pretty much where I am, most of the time. -- Riggs