From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 1 Sep 2000 16:45:46 -0400 From: Alexander Viro To: 9fans@cse.psu.edu Subject: Re: [9fans] FreeBSD 4.0 / Plan9 3rd ed. In-Reply-To: <200009012000.QAA26992@cse.psu.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Topicbox-Message-UUID: 01ff09ce-eac9-11e9-9e20-41e7f4b1d025 On Fri, 1 Sep 2000, Russ Cox wrote: > The Linux drawterm will not work > in most other places, even under > binary emulation, because it depends > on the task segment selector as > a unique thread id. This is the same Sorry? "other places" include 2.4, for one thing. Why using gross architecture-dependent tricks, when PID is there? On Linux thread==process. There is a rfork() equivalent (clone(2)) and model is exactly the same as on Plan 9 (process as a set of components that can be shared between several processes; fork() as a special case of more generic operation that copies a subset of components and uses the old ones for the rest, etc.) Use of TSS happened to work on x86 prior to 2.3.11 or so, but that relied on the details of task_struct allocation. 2.4 has TSS-per-CPU setup and doesn't bother with changing the register at all - it's cheaper to do everything by hands. Besides, it lifts the limit on number of processes and allows to avoid quite a few TLB flushes. Use getpid() - it's at least more portable than %tss and definitely much saner. > reason that the Inferno Linux binaries > don't work under other OSes with > Linux binary emulation. Ditto.